Skip to content

Commit

Permalink
feat: add command to reset chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
perzeuss committed Mar 8, 2024
1 parent 2602c62 commit c1cf113
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class DiscordBot {

if (interaction.commandName === 'chat') {
await this.handleChatCommand(interaction);
} else if (interaction.commandName === 'new-conversation') {
const cacheId = this.CACHE_MODE && this.CACHE_MODE === 'user' ? interaction.user.id : interaction.channelId;
conversationCache.delete(cacheId);
await interaction.reply('New conversation started!');
}
});
}
Expand All @@ -66,6 +70,14 @@ class DiscordBot {
.setDescription('Your message')
.setRequired(true))
.toJSON(),
new SlashCommandBuilder()
.setName('new-conversation')
.setDescription('Start a new conversation with the bot. This will clear the chat history.')
// .addStringOption(option =>
// option.setName('summarize')
// .setDescription('Summarize the current conversation history and take it over to the new conversation.')
// .setRequired(true))
.toJSON(),
];

const rest = new REST({ version: '9' }).setToken(this.TOKEN);
Expand Down

0 comments on commit c1cf113

Please sign in to comment.