简体   繁体   English

如何使用 discord.py 设置不可见状态

[英]how to set an invisible status using discord.py

Code代码

async def shutdown(ctx):

    if ctx.message.author.name == 'LouieMartin':

        await ctx.send('Shutting down...')

        await client.change_presence(status=discord.Status.invisible)

        quit()

Problem问题

The problem is the await client.change_presence(status=discord.Status.invisible) .问题是await client.change_presence(status=discord.Status.invisible)

Problem solution问题方案

There are no problem solutions that I can think of.没有我能想到的问题解决方案。

I think that it would be...我认为这将是...

await client.change_presence(status=discord.Status.offline)

instead of...代替...

await bot.change_presence(status=discord.Status.invisible)

This worked for my bot.这对我的机器人有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM