python - 如何使用 discord.py 设置不可见状态
问题描述
代码
async def shutdown(ctx):
if ctx.message.author.name == 'LouieMartin':
await ctx.send('Shutting down...')
await client.change_presence(status=discord.Status.invisible)
quit()
问题
问题是await client.change_presence(status=discord.Status.invisible)
.
问题方案
没有我能想到的问题解决方案。
解决方案
我认为这将是...
await client.change_presence(status=discord.Status.offline)
代替...
await bot.change_presence(status=discord.Status.invisible)
这对我的机器人有用。
推荐阅读
- npm - npm 运行开发命令错误 npm ERR!代码 ELIFECYCLE npm 错误!错误号 1
- javascript - 滚动显示问题 main.js 不适用于我的部分 html?
- delphi - 会话断开后如何恢复进度?
- python - ANSI 转义码,如控制台中的 [?25h?为什么?
- android - 如何替换存储在内部存储Android工作室中的文本文件中的行
- javascript - VueJS - 打开全局模式登录表单的最佳方式
- python - ID 为“None”的 djongo 公司不存在。也许它被删除了?
- phpstorm - 在不打开 PhpStorm 的情况下更改 PhpStorm 启动运行时
- android - 何时在 PlayStore 的应用内购买中调用“消费”
- python - 获取用于图像分割的 semtorch 学习模型的 TypeError