Python 3.6 不和谐机器人冷却时间消息



所以我有这个命令,它允许用户更改游戏并且它运行良好,但我对它进行了 15 秒的冷却,它也工作正常,但我的问题是让它显示一条消息,表明您处于冷却期或命令已成功执行。我是python的新手,这可能是一个简单的修复程序,所以我很抱歉浪费你的时间,但提前感谢

我的代码:

@client.command(name="status")
@commands.cooldown(1, 15, commands.BucketType.server)
async def client_status(*, status: str = None):
    """Change the bot's 'playing' status.
    Running this command without any arguments will turn the 'playing'     status off'
    """
    game = Game(name=status)
    await client.change_presence(game=game)

如果成员尝试调用当前处于冷却状态的命令,则会引发 CommandOnCooldown 异常并触发on_command_error。

虽然异步不记录它,但有一个事件on_command_completion

on_command_completion(command, ctx)

如果命令已成功完成其调用,则会调度此命令。

最新更新