From db09b0af99e9ed3125b4e5526ec7e31febdebe17 Mon Sep 17 00:00:00 2001 From: Joren Date: Tue, 18 Jun 2024 17:53:19 +0200 Subject: [PATCH] Increase buffer siwe --- main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 39f9d8c..b96be03 100644 --- a/main.go +++ b/main.go @@ -57,9 +57,8 @@ func init() { CoinRegexes[coin] = regexp.MustCompile(fullRegex) } ChannelBlacklist[server.ServerID] = server.ChannelBlacklist.Channels - - // Initialize MessageHistory for each server - MessageHistory[server.ServerID] = ringbuffer.NewRingBuffer(100) // Adjust buffer size as needed + + MessageHistory[server.ServerID] = ringbuffer.NewRingBuffer(4096) } if Token == "" { @@ -126,7 +125,7 @@ func checkMessageContent(s *discordgo.Session, server ServerConfig, m *discordgo message := formatMessage(server, coin, m.Author.Username, matchedAddress) if !server.AllowDuplicates && MessageHistory[server.ServerID].ContainsItem(message) { - return // Skip sending if duplicates are not allowed and message is in history + return } s.ChannelMessageSend(server.OutputChannelID, message)