我如何将流式传输更改为空闲?

时间:2021-07-23 20:06:03

标签: python discord discord.py

我将如何在下面更改为空闲和状态,以观察机器人所在的服务器?

@bot.event
async def on_ready():
  print(f'Loged in as {bot.user}\n')
  cmds = filter(lambda e: e.endswith(".py"), os.listdir("commands"))
  print(f"Loading Commands")
  for cmd in cmds:
    bot.load_extension(f"commands.{cmd[:-3]}")
    print(f"Loaded {cmd}")
  await bot.change_presence(activity=discord.Streaming(name=f"{len(bot.guilds)} servers  |  {prefix}help", url='https://discord.gg/Mws2mSjde6'))

1 个答案:

答案 0 :(得分:0)

试试看:

await bot.change_presence(activity=discord.Idle(name=f"{len(bot.guilds)} servers  |  {prefix}help"))