小编Mys*_*usK的帖子

Discord.py 重启命令

所以,我正在制作一个机器人,我想知道是否有一种方法可以使用如下命令重新启动它:我确实 p!restart 喜欢一个命令: p!shutdown 但对于那些来这里寻找关闭命令的人来说,不知道如何重新启动:

async def shutdown(ctx):
    id = str(ctx.author.id)
    if id == 'your_id_here':
        await ctx.send('Shutting down the bot!')
        await ctx.bot.logout()
    else:
        await ctx.send("You dont have sufficient permmisions to perform this action!")```
Run Code Online (Sandbox Code Playgroud)

python shutdown restart discord.py

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

discord.py ×1

python ×1

restart ×1

shutdown ×1