This commit is contained in:
c0re100 2025-05-01 18:12:43 +08:00
parent c695d13f46
commit dc9ae3ed54
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF

View file

@ -28,6 +28,10 @@ func CheckCommand(text string, entities []*TextEntity) string {
// e.g. ["/hello 123", "/hell o 123"] // e.g. ["/hello 123", "/hell o 123"]
// Result: "/hello", "/hell" // Result: "/hello", "/hell"
if i := strings.Index(text, " "); i != -1 { if i := strings.Index(text, " "); i != -1 {
// Fallback: remove @bot
if i2 := strings.Index(text, "@"); i2 != -1 {
return text[:i2]
}
return text[:i] return text[:i]
} }