【发布时间】:2018-05-03 03:02:25
【问题描述】:
我正在尝试将命令设置为具有 3 秒冷却时间的 python discord 机器人,如果在冷却时间之前使用该命令,则会发送一条消息。我该怎么做?这是命令的代码:
@client.command(pass_context=True)
@commands.cooldown(1, 3, commands.BucketType.channel)
async def message (ctx):
谢谢!
【问题讨论】:
-
使用 on_command_error 和 isinstance 检查是否是冷却问题,然后根据自己的喜好格式化。
标签: python python-3.x bots discord discord.py