use klipy instead of tenor

This commit is contained in:
2026-02-01 18:31:53 +01:00
parent 0c0efa645a
commit 79efc479f4
17 changed files with 1062 additions and 27 deletions

View File

@@ -122,12 +122,22 @@ export const joelResponder = {
const userId = message.author.id;
const guildId = message.guildId;
// Fetch guild options to check for enabled features
const guildOptions = await db
.select()
.from(botOptions)
.where(eq(botOptions.guild_id, guildId))
.limit(1);
const gifSearchEnabled = guildOptions.length > 0 && guildOptions[0].gif_search_enabled === 1;
// Create tool context for this conversation
const toolContext: ToolContext = {
userId,
guildId,
channelId: message.channelId,
authorName: author,
gifSearchEnabled,
};
// Classify the message to determine response style
@@ -157,7 +167,7 @@ export const joelResponder = {
}, style);
// Add tool instructions to the system prompt
const systemPromptWithTools = `${systemPrompt}
let systemPromptWithTools = `${systemPrompt}
=== MEMORY TOOLS ===
You have access to tools for managing memories about users:
@@ -168,6 +178,19 @@ You have access to tools for managing memories about users:
Feel free to look up memories when you want to make personalized insults.
The current user's ID is: ${userId}`;
// Add GIF tool instructions if enabled
if (gifSearchEnabled) {
systemPromptWithTools += `
=== GIF TOOL ===
You can search for and send funny GIFs! Use search_gif when you want to:
- React to something with a perfect GIF
- Express your emotions visually
- Be chaotic and random
- Make fun of someone with a relevant GIF
The GIF URL will appear in your response for the user to see.`;
}
// Get reply context if this is a reply
let prompt = message.cleanContent;
if (message.reference) {