From 7c707fb19e39c661c606571156e5f145fc25202d Mon Sep 17 00:00:00 2001 From: pdai006 Date: Sat, 2 Dec 2023 11:09:11 +0000 Subject: [PATCH] command log --- source/bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/bot.py b/source/bot.py index df94fc1..5422865 100644 --- a/source/bot.py +++ b/source/bot.py @@ -144,3 +144,11 @@ async def on_command_error(self, ctx, error): await ctx.send(error, delete_after=10) except discord.Forbidden: self.logger.warning("Missing Send messages permission for channel {0}".format(ctx.channel.id)) + + async def on_app_command_completion(self, interaction, command): + timestamp = int(datetime.now().timestamp()) + guild_id = interaction.guild_id + increment(self.conn, 'Settings', 'slash_count', ['guild_id'], [guild_id]) + res = upsert(self.conn, 'Settings', ['last_command'], [timestamp], ['guild_id'], [guild_id]) + if res: + self.conn.commit()