diff options
author | Parker <contact@pkrm.dev> | 2024-10-31 00:26:00 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-10-31 00:26:00 -0500 |
commit | 70e612882d1093b133d13302dccfba6aa2778474 (patch) | |
tree | 6b26a4dc377ccf209c37eabf673d6031fdc10987 /code/cogs/owner/stats.py | |
parent | c1b229f34c010108b0e7eb92de2102dfc07ae70c (diff) |
`black --line-length 79`
Diffstat (limited to 'code/cogs/owner/stats.py')
-rw-r--r-- | code/cogs/owner/stats.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/code/cogs/owner/stats.py b/code/cogs/owner/stats.py index 362dc6a..6ab9043 100644 --- a/code/cogs/owner/stats.py +++ b/code/cogs/owner/stats.py @@ -17,7 +17,8 @@ class Stats(commands.Cog): connection = sqlite3.connect("data/count.db") cursor = connection.cursor() cursor.execute( - "CREATE TABLE IF NOT EXISTS count (command_name, count, PRIMARY KEY (command_name))" + "CREATE TABLE IF NOT EXISTS count (command_name, count, PRIMARY" + " KEY (command_name))" ) connection.commit() connection.close() @@ -37,7 +38,8 @@ class Stats(commands.Cog): ) except sqlite3.IntegrityError: cursor.execute( - "UPDATE count SET count = count + ? WHERE command_name = ?", + "UPDATE count SET count = count + ? WHERE" + " command_name = ?", (count, command_name), ) @@ -65,16 +67,25 @@ class Stats(commands.Cog): ).fetchall() # Get the combined total amount of commands run - total_commands = cursor.execute("SELECT SUM(count) FROM count").fetchone()[0] + total_commands = cursor.execute( + "SELECT SUM(count) FROM count" + ).fetchone()[0] embed = discord.Embed( title="Statistics", - description=f"Total Guilds: `{len(self.bot.guilds):,}`\nTotal Commands: `{total_commands:,}`\n\nTotal Players: `{self.bot.lavalink.nodes[0].stats.playing_players}`\nLoad: `{round(self.bot.lavalink.nodes[0].stats.lavalink_load * 100, 2)}%`", + description=( + f"Total Guilds: `{len(self.bot.guilds):,}`\nTotal Commands:" + f" `{total_commands:,}`\n\nTotal Players:" + f" `{self.bot.lavalink.nodes[0].stats.playing_players}`\nLoad:" + f" `{round(self.bot.lavalink.nodes[0].stats.lavalink_load * 100, 2)}%`" + ), color=BOT_COLOR, ) for entry in data: - embed.add_field(name=entry[0], value=f"` {entry[1]:,} `", inline=True) + embed.add_field( + name=entry[0], value=f"` {entry[1]:,} `", inline=True + ) connection.close() await ctx.send(embed=embed) |