updated messageCreate.ts to fix bot-to-bot cooldowns not working
This commit is contained in:
@@ -89,7 +89,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
|
||||
|
||||
// Check for channel-wide bot-to-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) {
|
||||
log(`Checking bot-to-bot cooldown for channel ${message.channelId}.`)
|
||||
try {
|
||||
@@ -360,7 +360,7 @@ export default event(Events.MessageCreate, async ({ log, msgHist, ollama, client
|
||||
}
|
||||
|
||||
// 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
|
||||
const sentimentData = `User ${message.author.id} sentiment: ${userSentiment.toFixed(2)}, Bot sentiment: ${botSentiment.toFixed(2)}`
|
||||
|
||||
Reference in New Issue
Block a user