From 44f2d1d7e18f1e940e1dac386b23aab877d7ec8f Mon Sep 17 00:00:00 2001 From: scanash00 Date: Sun, 9 Nov 2025 14:59:51 -0900 Subject: [PATCH] Revert "idk what this is in my changes tab and idk what it is but yeah prolly works" This reverts commit 9c34b64a1884dc95f5208cb8d8606da36e715aeb. --- src/commands/utilities/ai.ts | 6 ++++-- src/utils/voteManager.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/commands/utilities/ai.ts b/src/commands/utilities/ai.ts index d839f42..a95a09b 100644 --- a/src/commands/utilities/ai.ts +++ b/src/commands/utilities/ai.ts @@ -242,7 +242,9 @@ You can use tools by placing commands in {curly braces}. Available tools: Use the wikipedia search when you want to look for information outside of your knowledge, state it came from Wikipedia if used. -When you use a tool, you'll receive a JSON response with the command results.`; +When you use a tool, you'll receive a JSON response with the command results if needed. + +**IMPORTANT:** The {reaction:} and {newmessage:} tools are NOT available in slash commands. Only use the tools listed above.`; const modelSpecificInstructions = usingDefaultKey ? '\n\n**IMPORTANT:** Please keep your responses under 3000 characters. Be concise and to the point.' @@ -488,7 +490,7 @@ async function makeAIRequestInternal( ): Promise { try { const openAIClient = getOpenAIClient(config.finalApiKey!, config.finalApiUrl); - const maxTokens = config.usingDefaultKey ? 1000 : 3000; + const maxTokens = config.usingDefaultKey ? 5000 : 8000; const currentConversation = [...conversation]; let iteration = 0; let finalResponse: AIResponse | null = null; diff --git a/src/utils/voteManager.ts b/src/utils/voteManager.ts index 62deb0a..f31d6f4 100644 --- a/src/utils/voteManager.ts +++ b/src/utils/voteManager.ts @@ -153,15 +153,15 @@ export async function recordVote( ); } } catch (error) { - console.error(`Error processing guild ${guild.id}:`, error); + logger.error(`Error processing guild ${guild.id}:`, error); } }), ); } } catch (error) { - console.error('Error in vote processing:', error); + logger.error('Error in vote processing:', error); } finally { - clientBot.destroy().catch(console.error); + clientBot.destroy().catch((err) => logger.error('Error destroying bot client:', err)); } logger.info(`User ${userId} voted - AI system will give +10 daily limit`); @@ -190,12 +190,12 @@ export async function recordVote( `\n` + `Thank you for your support! ❤️`, ) - .catch(console.error); + .catch((err) => logger.error('Failed to send vote DM:', err)); } - clientBot.destroy().catch(console.error); + clientBot.destroy().catch((err) => logger.error('Error destroying bot client:', err)); } catch (error) { - console.error('Failed to send vote thank you DM:', error); + logger.error('Failed to send vote thank you DM:', error); } await client.query('COMMIT'); @@ -207,7 +207,7 @@ export async function recordVote( }; } catch (error) { await client.query('ROLLBACK'); - console.error('Error recording vote:', error); + logger.error('Error recording vote:', error); throw new Error('Failed to record your vote. Please try again later.'); } finally { client.release(); -- 2.51.2