mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
refactor(main.py): change bot's presence activity to display the number of servers the bot is in
feat(main.py): add event handler for on_guild_join to update bot's presence activity when joining a new server
This commit is contained in:
11
main.py
11
main.py
@@ -20,12 +20,21 @@ bot.add_cog(cogs.Moderation(bot))
|
||||
async def on_ready():
|
||||
await bot.change_presence(
|
||||
activity=discord.Activity(
|
||||
type=discord.ActivityType.watching, name="your messages to answer you"
|
||||
type=discord.ActivityType.watching, name=f"{len(bot.guilds)} servers"
|
||||
)
|
||||
)
|
||||
debug("Bot is ready")
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_guild_join(guild):
|
||||
await bot.change_presence(
|
||||
activity=discord.Activity(
|
||||
type=discord.ActivityType.watching, name=f"{len(bot.guilds)} servers"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_application_command_error(ctx, error):
|
||||
debug(error)
|
||||
|
||||
Reference in New Issue
Block a user