diff --git a/core/events.py b/core/events.py index 0598ec173..4dbad77ed 100644 --- a/core/events.py +++ b/core/events.py @@ -7,6 +7,11 @@ from core.utils.chat_formatting import inline log = logging.getLogger("red") +INTRO = ("{0}===================\n" + "{0} Red - Discord Bot \n" + "{0}===================\n" + "".format(" " * 20)) + def init_events(bot, cli_flags): @@ -22,6 +27,8 @@ def init_events(bot, cli_flags): bot.uptime = datetime.datetime.utcnow() + print(INTRO) + if cli_flags.no_cogs is False: print("Loading packages...") failed = [] @@ -40,10 +47,26 @@ def init_events(bot, cli_flags): if packages: print("Loaded packages: " + ", ".join(packages)) - # total_channels = len([c for c in bot.get_all_channels()]) - # total_users = len(set([m for m in bot.get_all_members()])) + guilds = len(bot.guilds) + users = len(set([m for m in bot.get_all_members()])) - print("Ready and operational on {} servers.".format(len(bot.guilds))) + try: + data = await bot.application_info() + invite_url = discord.utils.oauth_url(data.id) + except: + if bot.user.bot: + invite_url = "Could not fetch invite url" + else: + invite_url = None + + if guilds: + print("Ready and operational on {} servers with a total of {} " + "users.".format(guilds, users)) + else: + print("Ready. I'm not in any server yet!") + + if invite_url: + print("\nInvite URL: {}\n".format(invite_url)) @bot.event async def on_command_error(error, ctx):