如何将discord.py机器人状态设置为侦听/观看/等

时间:2020-09-12 13:11:23

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

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

这是原始版本的代码,似乎无法重写

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

如何让机器人状态监听?

2 个答案:

答案 0 :(得分:0)

await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

答案 1 :(得分:0)

这是所有可能的活动

# "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"))