nechotron/filters.go

18 lines
312 B
Go

package nechotron
import "strings"
type FilterFn func(u *Update) bool
func TextStartsWith(text string) FilterFn {
return func(u *Update) bool {
return strings.HasPrefix(u.Text(), text)
}
}
func TextHas(text string) FilterFn {
return func(u *Update) bool {
return strings.Contains(u.Text(), text)
}
}