diff --git a/src/commands/utilities/ai.ts b/src/commands/utilities/ai.ts index a95a09b..d839f42 100644 --- a/src/commands/utilities/ai.ts +++ b/src/commands/utilities/ai.ts @@ -242,9 +242,7 @@ 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 if needed. - -**IMPORTANT:** The {reaction:} and {newmessage:} tools are NOT available in slash commands. Only use the tools listed above.`; +When you use a tool, you'll receive a JSON response with the command results.`; const modelSpecificInstructions = usingDefaultKey ? '\n\n**IMPORTANT:** Please keep your responses under 3000 characters. Be concise and to the point.' @@ -490,7 +488,7 @@ async function makeAIRequestInternal( ): Promise { try { const openAIClient = getOpenAIClient(config.finalApiKey!, config.finalApiUrl); - const maxTokens = config.usingDefaultKey ? 5000 : 8000; + const maxTokens = config.usingDefaultKey ? 1000 : 3000; const currentConversation = [...conversation]; let iteration = 0; let finalResponse: AIResponse | null = null; diff --git a/src/utils/voteManager.ts b/src/utils/voteManager.ts index f31d6f4..62deb0a 100644 --- a/src/utils/voteManager.ts +++ b/src/utils/voteManager.ts @@ -153,15 +153,15 @@ export async function recordVote( ); } } catch (error) { - logger.error(`Error processing guild ${guild.id}:`, error); + console.error(`Error processing guild ${guild.id}:`, error); } }), ); } } catch (error) { - logger.error('Error in vote processing:', error); + console.error('Error in vote processing:', error); } finally { - clientBot.destroy().catch((err) => logger.error('Error destroying bot client:', err)); + clientBot.destroy().catch(console.error); } 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((err) => logger.error('Failed to send vote DM:', err)); + .catch(console.error); } - clientBot.destroy().catch((err) => logger.error('Error destroying bot client:', err)); + clientBot.destroy().catch(console.error); } catch (error) { - logger.error('Failed to send vote thank you DM:', error); + console.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'); - logger.error('Error recording vote:', error); + console.error('Error recording vote:', error); throw new Error('Failed to record your vote. Please try again later.'); } finally { client.release();