mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
Fallback
This commit is contained in:
parent
c695d13f46
commit
dc9ae3ed54
1 changed files with 4 additions and 0 deletions
|
|
@ -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]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue