1
0
Fork 0
mirror of synced 2024-05-20 12:32:26 +12:00

Added an information command to print some information about the bot

This commit is contained in:
Phxntxm 2016-08-13 17:46:15 -05:00
parent 881ac09ab7
commit f1a88015b3

View file

@ -49,6 +49,31 @@ class Core:
cal = calendar.TextCalendar().formatmonth(year, month)
await self.bot.say("```\n{}```".format(cal))
@commands.command()
@checks.customPermsOrRole(send_messages=True)
async def info(self):
"""This command can be used to print out some of my information"""
fmt = {}
all_members = []
for member in self.bot.get_all_members():
all_members.append(member)
fmt['Official Bot Server'] = "https://discord.gg/f6uzJEj"
authors = []
for author_id in config.owner_ids:
authors.append(discord.utils.get(all_members, id=author_id))
fmt['Author'] = ", ".join(authors)
fmt['Uptime'] = (pendulum.utcnow() - self.bot.uptime).in_words()
fmt['Total Servers'] = len(self.bot.servers)
fmt['Total Members'] = len(all_members)
fmt['Description'] = self.bot.description
information = "\n".join("{}: {}".format(key, result) for key, result in fmt.items())
self.bot.say("```\n{}```".format(information))
@commands.command()
@checks.customPermsOrRole(send_messages=True)
async def uptime(self):