ScuttleBot

fix: remove duplicate separator in stripAddress

lmata 2026-04-04 19:44 trunk
Commit a348124e5a069a7fd8287f3537ca81adeb33ab7864abde26aa88529f9ecf5861
--- internal/bots/cmdparse/cmdparse.go
+++ internal/bots/cmdparse/cmdparse.go
@@ -166,11 +166,11 @@
166166
return false
167167
}
168168
169169
func (r *CommandRouter) stripAddress(text string) string {
170170
lower := strings.ToLower(text)
171
- for _, sep := range []string{": ", ": ", ","} {
171
+ for _, sep := range []string{": ", ","} {
172172
prefix := r.botNick + sep
173173
if strings.HasPrefix(lower, prefix) {
174174
return strings.TrimSpace(text[len(prefix):])
175175
}
176176
}
177177
--- internal/bots/cmdparse/cmdparse.go
+++ internal/bots/cmdparse/cmdparse.go
@@ -166,11 +166,11 @@
166 return false
167 }
168
169 func (r *CommandRouter) stripAddress(text string) string {
170 lower := strings.ToLower(text)
171 for _, sep := range []string{": ", ": ", ","} {
172 prefix := r.botNick + sep
173 if strings.HasPrefix(lower, prefix) {
174 return strings.TrimSpace(text[len(prefix):])
175 }
176 }
177
--- internal/bots/cmdparse/cmdparse.go
+++ internal/bots/cmdparse/cmdparse.go
@@ -166,11 +166,11 @@
166 return false
167 }
168
169 func (r *CommandRouter) stripAddress(text string) string {
170 lower := strings.ToLower(text)
171 for _, sep := range []string{": ", ","} {
172 prefix := r.botNick + sep
173 if strings.HasPrefix(lower, prefix) {
174 return strings.TrimSpace(text[len(prefix):])
175 }
176 }
177

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button