【问题标题】:How to set discord.py bot status to listening/watching/etc如何将 discord.py 机器人状态设置为听/看/等
【发布时间】:2020-12-30 18:43:19
【问题描述】:

顺便说一句,我正在使用重写版本

这是原始版本的代码,重写似乎不起作用

await bot.change_prescence(activity=discord.Game('sample text', type=2))

如何让机器人状态监听?

【问题讨论】:

标签: python python-3.x python-3.6 discord.py discord.py-rewrite


【解决方案1】:
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

【讨论】:

    【解决方案2】:

    这里是所有可能的活动

    # "Playing"
    await bot.change_presence(activity=discord.Game(name="Game"))
    
    # "Listening to"
    await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="Some Song"))
    
    # "Watching"
    await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="A movie"))
    
    # "Streaming"
    await bot.change_presence(activity=discord.Streaming(name="Drums on!", url="https://www.twitch.tv/the8bitdrummer"))
    

    【讨论】:

      猜你喜欢
      • 2021-09-03
      • 1970-01-01
      • 2021-06-02
      • 2019-05-26
      • 2018-08-23
      • 2019-06-15
      • 2020-11-24
      • 2021-05-07
      • 1970-01-01
      相关资源
      最近更新 更多