adding server count to the presence message

This commit is contained in:
Mylloon 2021-09-17 10:41:54 +02:00
parent abd2ffb116
commit e015ca8ae8

View file

@ -44,10 +44,21 @@ async def on_resumed():
print("Reconnecté !")
@client.event
async def on_ready():
async def on_ready(update_changePresence = False):
"""Triggered when the bot is ready to operate"""
await client.change_presence(status = discord.Status.online, activity = discord.Activity(name = f"{customPrefix}help", type = discord.ActivityType.playing))
print("Bot prêt.")
await client.change_presence(status = discord.Status.online, activity = discord.Activity(name = f"{customPrefix}help · {len(client.guilds)} serveur{'s' if len(client.guilds) > 1 else ''}", type = discord.ActivityType.playing))
if update_changePresence == False:
print("Bot prêt.")
@client.event
async def on_guild_join(_):
"""Triggered when the bot join a new guild"""
await on_ready(True)
@client.event
async def on_guild_remove(_):
"""Triggered when the bot left a guild"""
await on_ready(True)
@client.event
async def on_command_error(ctx, error):