【发布时间】:2021-03-11 22:31:15
【问题描述】:
我希望我的 discord 机器人的命令有冷却时间。我尝试了其他方法,但它们似乎都不适用于我所拥有的。
@client.event
async def on_message(message):
if message.content == 'shear sheep':
await message.channel.send('you sheared your sheep, gaining 1 wool.')
#cooldown?
【问题讨论】:
-
如果你使用
commands.Bot接口,并使用装饰器创建命令,你可以使用内置的冷却系统,否则你需要为冷却做某种形式的映射
标签: python discord bots discord.py