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
17
src/main.py
17
src/main.py
|
@ -44,10 +44,21 @@ async def on_resumed():
|
||||||
print("Reconnecté !")
|
print("Reconnecté !")
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_ready():
|
async def on_ready(update_changePresence = False):
|
||||||
"""Triggered when the bot is ready to operate"""
|
"""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))
|
||||||
print("Bot prêt.")
|
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
|
@client.event
|
||||||
async def on_command_error(ctx, error):
|
async def on_command_error(ctx, error):
|
||||||
|
|
Reference in a new issue