From af446f4cfd9d79699cf1ce83cb5392cc095d15f5 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Mon, 24 Dec 2018 11:23:14 +0300 Subject: [PATCH] Add "Robocop has started! x has y members!" --- Robocop.py | 8 ++++++++ config.py.template | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Robocop.py b/Robocop.py index aae340d..9f93e89 100755 --- a/Robocop.py +++ b/Robocop.py @@ -74,6 +74,14 @@ async def on_ready(): log.info(f'\nLogged in as: {bot.user.name} - ' f'{bot.user.id}\ndpy version: {discord.__version__}\n') game_name = f"{config.prefixes[0]}help" + + # Send "Robocop has started! x has y members!" + guild = discord.utils.get(bot.guilds, id=config.guild_whitelist[0]) + log_channel = guild.get_channel(config.log_channel) + msg = f"{bot.user.name} has started! "\ + f"{guild.name} has {guild.member_count} members!" + await log_channel.send(msg) + await bot.change_presence(activity=discord.Game(name=game_name)) diff --git a/config.py.template b/config.py.template index 2517393..40cf5b8 100644 --- a/config.py.template +++ b/config.py.template @@ -17,6 +17,8 @@ embed_desc = "Robocop-NG is developed by [Ave](https://github.com/aveao)"\ # Minimum account age required to join the discord min_age = datetime.timedelta(minutes=15) +# IMPORTANT: It's assumed that the first guild here +# is the one containing log_channel guild_whitelist = [ 526372255052201993, # NotSwitched discord 269333940928512010 # ReSwitched discord