Skip to content

Commit

Permalink
command log
Browse files Browse the repository at this point in the history
  • Loading branch information
Baviaan committed Dec 2, 2023
1 parent 224bdf3 commit 7c707fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 7c707fb

Please sign in to comment.