diff --git a/payphone/cogs/mods/cog.py b/payphone/cogs/mods/cog.py index 4abb18b..73e5750 100644 --- a/payphone/cogs/mods/cog.py +++ b/payphone/cogs/mods/cog.py @@ -295,6 +295,32 @@ class Mods(base.Cog): sys.exit() + @commands.command() + @commands.is_owner() + async def stats(self, ctx: commands.Context) -> None: + """ + Shows all Payphone's stats. + """ + + stats = [ + f"On-call Channels: {await self.bot.redis.scard(constants.CHANNELS_ONCALL_SET)}", + f"Searching Channels: {await self.bot.redis.scard(constants.CHANNELS_ONCALL_SET)}", + f"Messages: {await models.Message.all().count()}", + f"Message Contents: {await models.MessageContent.all().count()}", + f"Calls: {await models.Call.all().count()}", + f"Ongoing Calls: {await models.Call.filter(ended_at=None).count()}", + f"Bans: {await models.Ban.all().count()}", + f"Reports: {await models.Report.all().count()}", + f"On-review Reports: {await models.Report.filter(status=models.ReportStatus.ON_REVIEW).count()}", + f"Users: {await models.User.all().count()}", + f"Profiles: {await models.Profile.all().count()}", + f"Servers: {await models.Server.all().count()}", + f"Shards: {self.bot.shard_count}", + f"Current Shard: {ctx.guild.shard_id + 1}" + ] + + await ctx.send(f"```\n{"\n".join(stats)}\n```") + def setup(b: bot.Payphone) -> None: """Load the cog into the bot.