首页 > 解决方案 > 如何使用 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).

问题方案

没有我能想到的问题解决方案。

标签: pythondiscorddiscord.py

解决方案


我认为这将是...

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

代替...

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

这对我的机器人有用。


推荐阅读