我正在写一个简短的命令,让我把状态设置为任何我想要的状态,但是我读了文档,没有办法清除状态。我唯一找到的是3年前的一个讨论,但没有用。
这是我的尝试。
@bot.command()
async def statc(c):
print(f"Works")
await bot.change_presence(status=None)
根据 文件,您可以设置 status=None
引用文档中的话:"如果[状态]。None
那么 状况.在线 被使用。"这是默认(清除)状态。
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')