【问题标题】: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"))