我正在使用 Discord.py Rewrite 来制作一个 Discord 机器人。我有一个名为 的命令work,其代码如下:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix="c!")
# on_ready command
@client.command()
async def work(ctx):
author_id = ctx.author.id
currency_dict[author_id] += 50
await ctx.send("You Gained 50 Coins")
# currency_dict is a dictionary that is already defined
Run Code Online (Sandbox Code Playgroud)
有什么办法可以让用户每 30 秒只能使用一次命令吗?谢谢!