async def ImagesSent(self, ctx, mx=10): """ See ImagesSent Stats. `amount shown` is the amount of users that \ should be displayed in the leaderboard. Min: 1, Max: 20. """ if mx < 0: mx = 1 elif mx > 20: mx = 20 column = SQLFunctions.get_statistic_rows("ImagesSent", mx, self.conn) embed = await self.get_top_users(single_statistic=column, single_statistic_name="Images Sent") await ctx.send(embed=embed)
async def VoteCount(self, ctx, mx=10): """ See only ReactionsTakenAway Stats. `amount shown` is the amount of users that \ should be displayed in the leaderboard. Min: 1, Max: 20. """ if mx < 0: mx = 1 elif mx > 20: mx = 20 column = SQLFunctions.get_statistic_rows("VoteCount", mx, self.conn) embed = await self.get_top_users( single_statistic=column, single_statistic_name="Quote Battles voted on") await ctx.send(embed=embed)
async def statistics(self, ctx, user=None): """ Used to call the statistics page of a user or of the server. The user parameter can be another user or "top" to get the top three users \ of each category. """ if ctx.invoked_subcommand is None: statistic_columns = { "MessagesSent": [], "MessagesDeleted": [], "MessagesEdited": [], "CharactersSent": [], "WordsSent": [], "SpoilersSent": [], "EmojisSent": [], "FilesSent": [], "FileSizeSent": [], "ImagesSent": [], "ReactionsAdded": [], "ReactionsRemoved": [], "ReactionsReceived": [], "ReactionsTakenAway": [], "VoteCount": [] } for key in statistic_columns.keys(): statistic_columns[key] = SQLFunctions.get_statistic_rows( key, 5000, self.conn) if user is None: embed = await self.create_embed(ctx.message.author, statistic_columns) await ctx.send(embed=embed) else: try: memberconverter = discord.ext.commands.MemberConverter() member = await memberconverter.convert(ctx, user) except discord.ext.commands.errors.BadArgument: await ctx.send( "Invalid user. Mention the user for this to work.") raise discord.ext.commands.errors.BadArgument embed = await self.create_embed(member, statistic_columns) await ctx.send(embed=embed)
async def top(self, ctx): statistic_columns = { "MessagesSent": [], "MessagesDeleted": [], "MessagesEdited": [], "CharactersSent": [], "WordsSent": [], "SpoilersSent": [], "EmojisSent": [], "FilesSent": [], "FileSizeSent": [], "ImagesSent": [], "ReactionsAdded": [], "ReactionsRemoved": [], "ReactionsReceived": [], "ReactionsTakenAway": [] } for key in statistic_columns.keys(): statistic_columns[key] = SQLFunctions.get_statistic_rows( key, 3, self.conn) embed = await self.get_top_users(statistic_columns) await ctx.send(embed=embed)