def info(self, ctx):
"""Show some of the more statistical information about me.
This information includes the current version(s), number of commands, amount of servers, channels, users, uptime, and average websocket ping.
**Usage:** `g_info`
**Permission:** User"""
commands = len(self.bot.commands)
cogs = len(self.bot.cogs)
version = discord.__version__
before = time.monotonic()
await (await self.bot.ws.ping())
after = time.monotonic()
ping = (after - before) * 1000
pversion = platform.python_version()
server_count = 0
member_count = 0
channel_count = 0
for server in self.bot.guilds:
server_count += 1
for channel in server.channels:
channel_count += 1
for member in server.members:
member_count += 1
await ctx.send("""```prolog
=========[ Bot Information ]=========
Commands : {0}
Cogs : {1}
Version : {2}
DiscordPY Version : {3}
Python Version : {4}
Websocket Ping : {5:.0f}ms
Uptime : {6}
=========[ Guild Information ]=========
Guilds : {7}
Users : {8}
Channels : {9}
Host : heroku```""".format(commands, cogs, self.bot.version, version, pversion, ping, self.get_bot_uptime(), server_count, member_count, channel_count))
评论列表
文章目录