summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-04 08:26:30 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-04 08:26:30 +0300
commite3965db3c7e7f5e3cdbf5d03ac06103c2709c0d8 (patch)
tree3f8efd23b4f8686fb1e989531b705af05d65fe19 /bot.go
parent654d6a47ec2d991277e87ca5b2144076eb9f7458 (diff)
Enha: use slices methods
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/bot.go b/bot.go
index 13d488a..a28097f 100644
--- a/bot.go
+++ b/bot.go
@@ -19,6 +19,7 @@ import (
"os"
"path"
"regexp"
+ "slices"
"strconv"
"strings"
"sync"
@@ -154,15 +155,8 @@ func filterMessagesForCharacter(messages []models.RoleMsg, character string) []m
filtered = append(filtered, msg)
continue
}
- // Check if character is in KnownTo list
- found := false
- for _, k := range msg.KnownTo {
- if k == character {
- found = true
- break
- }
- }
- if found {
+ if slices.Contains(msg.KnownTo, character) {
+ // Check if character is in KnownTo lis
filtered = append(filtered, msg)
}
}