首页 > 解决方案 > Discord.py Killswitch

问题描述

我在 discord.py 上的 killswitch 似乎没有工作,我也不清楚为什么。有人可以指出我犯的任何错误吗?谢谢你。

@client.command(aliases=["shut","shutdown","quit","stop_that","stahp", "kill"])
async def stop(ctx):
   await ctx.send("Attention: I have been murdered.")
   await client.logout()

标签: pythondiscorddiscord.py

解决方案


看来代码没问题,再试一次,但不要.logout()使用close(). 另外,我建议将其设为仅所有者命令。


推荐阅读