async def info(self, ctx): """Get Information about Xenon""" embed = ctx.em("")["embed"] embed.description = "Server Backups, Templates and more" embed.title = "Xenon" embed.set_thumbnail(url=self.bot.user.avatar_url) embed.add_field(name="Invite", value=f"[Click Here]({ctx.bot.invite})") embed.add_field(name="Discord", value="[Click Here](https://discord.club/discord)") embed.add_field(name="Prefix", value=ctx.config.prefix) embed.add_field(name="Guilds", value=helpers.format_number( await self.bot.get_guild_count())) embed.add_field(name="Shards", value=self.bot.shard_count or 1) embed.add_field(name="Users", value=helpers.format_number(await self.bot.get_user_count())) app_info = await ctx.bot.application_info() if app_info.team: embed.set_footer(text=f"Owned by {app_info.team.owner}") else: embed.set_footer(text=f"Owned by {app_info.owner}") await ctx.send(embed=embed)
async def info(self, ctx): embed = ctx.em("")["embed"] embed.description = "Server Backups, Templates and more" embed.title = "Xenon" embed.set_thumbnail(url=self.bot.user.avatar_url) embed.add_field(name="Invite", value="[Click Here](https://discord.club/invite/xenon)") embed.add_field(name="Discord", value="[Click Here](https://discord.club/discord)") embed.add_field(name="Prefix", value=ctx.config.prefix) embed.add_field(name="Guilds", value=helpers.format_number(await self.bot.get_guild_count())) embed.add_field(name="Shards", value=self.bot.shard_count or 1) embed.add_field(name="Users", value=helpers.format_number(await self.bot.get_user_count())) await ctx.send(embed=embed)
async def shards(self, ctx): """Show information about the virtual shards in this physical shard""" table = PrettyTable() table.field_names = ["Shard-Id", "Latency", "Guilds", "Users"] shards = await self.bot.get_shard_stats() for shard_id, values in shards.items(): prefix = '> ' if str(shard_id) == str(ctx.guild.shard_id) else '' table.add_row([prefix + str(shard_id), f"{round(values['latency'] * 1000, 1)} ms", helpers.format_number(values["guilds"]), helpers.format_number(values["users"])]) pages = formatter.paginate(str(table)) for page in pages: await ctx.send(f"```diff\n{page}```")
async def shards(self, ctx): """Show information about the virtual shards in this physical shard""" table = PrettyTable() table.field_names = ["Shard-Id", "Latency", "Guilds", "Users"] shards = await self.bot.get_shards() for shard in shards: latency = f"{round(shard['latency'] * 1000, 1)} ms" if (datetime.utcnow() - shard["seen"]) > timedelta(minutes=3): latency = "offline?" table.add_row([str(shard["id"]), latency, helpers.format_number(shard["guilds"]), helpers.format_number(shard["users"])]) pages = formatter.paginate(str(table)) for page in pages: await ctx.send(f"```diff\n{page}```")