python - 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()
解决方案
看来代码没问题,再试一次,但不要.logout()
使用close()
. 另外,我建议将其设为仅所有者命令。
推荐阅读
- excel - 网页抓取以选择网站中的下拉列表
- java - 线程“主”java.lang.NoClassDefFoundError 中的异常:org/opencv/core/Core
- kubernetes - 如何使用 kubeadm-init 配置参数-“controlPlaneEndpoint”?
- spring-boot - 从jsp表单更新数据库表
- java - 将其存储为字符串后如何获得相同的字节数组?
- javascript - 将 JavaScript 变量添加到 Django 静态 url
- properties - 在corda的node.conf文件中使用环境变量
- azure - 如何在 Azure 门户中监控 Azure 数据同步过程
- python-3.x - 如何加载保存的 argparser 并覆盖当前的?
- javascript - 具有未知属性的对象的 AJV 模式验证