且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何停止运行不和谐的机器人进程(python)

更新时间:2023-01-17 23:03:42

  • 如果你添加我写在那里的代码(只有所有者可以使用)将关闭已经运行的机器人(写 /shutdown in不和谐服务器或任何你的前缀).
  • 但是,在使用此代码保存机器人后,您可能需要重新启动 PC.

    However, you may need a PC restart after saving the bot with this code.

@client.command()
@commands.is_owner()
async def shutdown(ctx):
    await ctx.bot.logout()

  • 所以每次如果你想编辑你的命令,你写/shutdown 并编辑它,然后你可以重新启动它.
  • 我希望这对你有用并且我可以提供帮助.

    I hope this works for you and that I could help.