我正在编写一个简短的命令,让我将状态设置为我想要的任何内容,但我阅读了文档,无法清除状态。我唯一发现的是 3 年前的讨论,这不起作用
这是我的尝试:
@bot.command()
async def statc(c):
print(f"Works")
await bot.change_presence(status=None)
根据文档,您可以设置status=None
,以引用文档"如果 [状态]None
,则使用 Status.online",这是默认 (/clear( 状态。
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>')
@bot.command()
async def stati(ctx):
await bot.change_presence(status=discord.Status.idle)
@bot.command()
async def statc(c):
await bot.change_presence(status=None)
bot.run('app token')