diff --git a/nomen/main.py b/nomen/main.py index 6dd13a7..3204e8e 100644 --- a/nomen/main.py +++ b/nomen/main.py @@ -191,6 +191,26 @@ async def on_error(event, *args, **kwargs): log.error(f"Error in event {event}.\nargs={pargs}\nkwargs={pkwargs}", exc_info=sys.exc_info()) +@bot.listen() +async def on_guild_join(guild): + await bot.owner.send( + f"""\ +# Guild Joined: {guild.name} +Guild ID: `{guild.id}` +Member Count: `{guild.member_count}`""" + ) + + +@bot.listen() +async def on_guild_remove(guild): + await bot.owner.send( + f"""\ +# Guild Removed: {guild.name} +Guild ID: `{guild.id}` +Member Count: `{guild.member_count}`""" + ) + + help_timeouts = {} @@ -352,7 +372,7 @@ async def admin_eval(ctx, *, body: str): @bot.command() async def ping(ctx): - await ctx.send("Pong") + await ctx.send(f"Pong!\nLatency: {bot.latency*1000:.1f}ms") @bot.command() @@ -385,6 +405,7 @@ async def portrait(ctx): def run(): + log.info("Starting Nomen") try: run_db_migrations(DB_FILE) except RuntimeError: