Python 如何使帮会计数器处于我的机器人状态。不和谐
如何使我的机器人显示帮会计数器处于状态? 我是Discord.py的新手,需要最新版本的帮助Python 如何使帮会计数器处于我的机器人状态。不和谐,python,discord,discord.py,Python,Discord,Discord.py,如何使我的机器人显示帮会计数器处于状态? 我是Discord.py的新手,需要最新版本的帮助 wait bot.change_presence(status=discord.status.online,activity=discord.Game(f'prefix$| service(…)guilds)) 顺便说一句,我的英语不好,如果我的问题不完美,很抱歉。您可能正在寻找bot.guilds,这里有一个示例,说明如何在bot加入/离开公会时更新活动 @bot.event 加入(公会)时的异步定义
wait bot.change_presence(status=discord.status.online,activity=discord.Game(f'prefix$| service(…)guilds))
顺便说一句,我的英语不好,如果我的问题不完美,很抱歉。您可能正在寻找
bot.guilds
,这里有一个示例,说明如何在bot加入/离开公会时更新活动
@bot.event
加入(公会)时的异步定义:
当前协会=len(bot.guilds)
等待bot.change_presence(status=discord.status.online,activity=discord.Game(f'prefix$| service{current_guilds}guilds'))
@机器人事件
帮会上的异步定义删除(帮会):
当前协会=len(bot.guilds)
等待bot.change_presence(status=discord.status.online,activity=discord.Game(f'prefix$| service{current_guilds}guilds'))
参考: