Added an information command to print some information about the bot
This commit is contained in:
parent
881ac09ab7
commit
f1a88015b3
25
cogs/core.py
25
cogs/core.py
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue