adding server count to the presence message
This commit is contained in:
parent
abd2ffb116
commit
e015ca8ae8
1 changed files with 14 additions and 3 deletions
15
src/main.py
15
src/main.py
|
@ -44,11 +44,22 @@ 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))
|
||||
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):
|
||||
"""Triggered when a command enconter an error"""
|
||||
|
|
Reference in a new issue