From dc9ae3ed546e976f6360c5ba050dde64c91c077f Mon Sep 17 00:00:00 2001 From: c0re100 Date: Thu, 1 May 2025 18:12:43 +0800 Subject: [PATCH] Fallback --- client/extra.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/extra.go b/client/extra.go index 0a6c60f..827c857 100644 --- a/client/extra.go +++ b/client/extra.go @@ -28,6 +28,10 @@ func CheckCommand(text string, entities []*TextEntity) string { // e.g. ["/hello 123", "/hell o 123"] // Result: "/hello", "/hell" if i := strings.Index(text, " "); i != -1 { + // Fallback: remove @bot + if i2 := strings.Index(text, "@"); i2 != -1 { + return text[:i2] + } return text[:i] }