2024-05-09 17:42:42 +03:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mymmrac/telego"
|
|
|
|
th "github.com/mymmrac/telego/telegohandler"
|
|
|
|
)
|
|
|
|
|
|
|
|
func MatchCommand(command string, msg *telego.Message) bool {
|
|
|
|
return th.CommandEqual(command)(telego.Update{Message: msg})
|
|
|
|
}
|
2024-05-13 21:46:05 +03:00
|
|
|
|
|
|
|
func HasCommand(msg *telego.Message) bool {
|
|
|
|
if msg == nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return th.CommandRegexp.MatchString(msg.Text)
|
|
|
|
}
|