Commit c5b5b1b 1 parent 5163eb3 commit c5b5b1b Copy full SHA for c5b5b1b
File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import discord
2
+ from discord .ext import commands
3
+ from discord import app_commands
4
+
5
+ class Wipe (commands .Cog ):
6
+ def __init__ (self , bot : commands .Bot ):
7
+ self .bot = bot
8
+
9
+ @app_commands .command (name = "wipe" , description = "Wipe chat history" )
10
+ async def wipe (self , interaction : discord .Interaction ):
11
+ user_id = interaction .user .id
12
+ chat_histories = self .bot .conversation_histories
13
+
14
+ if user_id in chat_histories :
15
+ chat_histories [user_id ] = []
16
+ await interaction .response .send_message ("Your chat history has been wiped." )
17
+ else :
18
+ await interaction .response .send_message ("You don't have any chat history with me" )
19
+
20
+ async def setup (bot : commands .Bot ) -> None :
21
+ await bot .add_cog (Wipe (bot ))
You can’t perform that action at this time.
0 commit comments