updated messageCreate.ts to fix bot-to-bot cooldowns not working
Some checks failed
Builds / Discord-Node-Build (push) Has been cancelled
Builds / Discord-Ollama-Container-Build (push) Has been cancelled
Coverage / Discord-Node-Coverage (push) Has been cancelled

This commit is contained in:
quarterturn
2025-05-24 10:25:40 -04:00
parent a02c28e087
commit 5cead668fb

View File

@@ -89,7 +89,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
// Check for channel-wide bot-to-bot cooldown // Check for channel-wide bot-to-bot cooldown
const channelCooldownKey = `channel:${message.channelId}:bot_cooldown` const channelCooldownKey = `channel:${message.channelId}:bot_cooldown`
const cooldownPeriod = 60 // 1 minute const cooldownPeriod = 300 // Increased from 60 to 300 seconds (5 minutes)
if (isBotMessage) { if (isBotMessage) {
log(`Checking bot-to-bot cooldown for channel ${message.channelId}.`) log(`Checking bot-to-bot cooldown for channel ${message.channelId}.`)
try { try {
@@ -360,7 +360,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
} }
// Log initial sentiments with two decimals // Log initial sentiments with two decimals
log(`Initial sentiments - User ${message.author.id}: ${userSentiment.toFixed(2)}, Bot: ${ OLLAMA_NUM_LAYERS=40botSentiment.toFixed(2)}`) log(`Initial sentiments - User ${message.author.id}: ${userSentiment.toFixed(2)}, Bot: ${botSentiment.toFixed(2)}`)
// Construct sentiment data for prompt // Construct sentiment data for prompt
const sentimentData = `User ${message.author.id} sentiment: ${userSentiment.toFixed(2)}, Bot sentiment: ${botSentiment.toFixed(2)}` const sentimentData = `User ${message.author.id} sentiment: ${userSentiment.toFixed(2)}, Bot sentiment: ${botSentiment.toFixed(2)}`