我想将机器人状态从播放更改为观看。我已经试过了,但它仍在播放状态:
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
PREFIX = ("$")
bot = commands.Bot(command_prefix=PREFIX, description='Hi')
@bot.event
async def on_ready():
activity = discord.Game(name="Netflix", type=3)
await bot.change_presence(status=discord.Status.idle, activity=activity)
print("Bot is ready!")
bot.run('TOKEN')
原文由 Squv 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以使用以下代码行,具体取决于您要将机器人更改为的活动:
参考:
bot.change_presence