Documentation ¶
Index ¶
- func And(filters ...tgo.Filter) tgo.Filter
- func Blacklist(IDs ...int64) tgo.Filter
- func Command(cmd, botUsername string) tgo.Filter
- func Commands(prefix, botUsername string, cmds ...string) tgo.Filter
- func ExtractUpdate(update *tgo.Update) any
- func ExtractUpdateText(update *tgo.Update) string
- func False() tgo.Filter
- func HasMessage() tgo.Filter
- func IsCallbackQuery() tgo.Filter
- func IsChannelPost() tgo.Filter
- func IsChatJoinRequest() tgo.Filter
- func IsChatMember() tgo.Filter
- func IsChosenInlineResult() tgo.Filter
- func IsEditedChannelPost() tgo.Filter
- func IsEditedMessage() tgo.Filter
- func IsInlineQuery() tgo.Filter
- func IsMessage() tgo.Filter
- func IsMyChatMember() tgo.Filter
- func IsPoll() tgo.Filter
- func IsPollAnswer() tgo.Filter
- func IsPreCheckoutQuery() tgo.Filter
- func IsShippingQuery() tgo.Filter
- func Not(filter tgo.Filter) tgo.Filter
- func Or(filters ...tgo.Filter) tgo.Filter
- func Regex(reg *regexp.Regexp) tgo.Filter
- func Text(text string) tgo.Filter
- func Texts(texts ...string) tgo.Filter
- func True() tgo.Filter
- func Whitelist(IDs ...int64) tgo.Filter
- func WithPrefix(prefix string) tgo.Filter
- func WithSuffix(suffix string) tgo.Filter
- type Filter
- type FilterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func And ¶
And Behaves like the && operator; returns true if all of the passes filters passes, otherwise returns false.
func Blacklist ¶
Blacklist compares IDs with the sender-id of the message or callback query. returns false if sender-id is in the blacklist.
func ExtractUpdate ¶
func ExtractUpdateText ¶
func HasMessage ¶
func IsCallbackQuery ¶
func IsChannelPost ¶
func IsChatJoinRequest ¶
func IsChatMember ¶
func IsChosenInlineResult ¶
func IsEditedChannelPost ¶
func IsEditedMessage ¶
func IsInlineQuery ¶
func IsMyChatMember ¶
func IsPollAnswer ¶
func IsPreCheckoutQuery ¶
func IsShippingQuery ¶
func Or ¶
Or behaves like the || operator; returns true if at least one of the passed filters passes. returns false if none of them passes.
func Regex ¶
Regex matches the update (message's text or caption, callback query, inline query) with the passed regexp.
func Text ¶
Text compares the update (message's text or caption, callback query, inline query) with the passed text.
func Texts ¶
Texts compares the update (message's text or caption, callback query, inline query) with the passed texts.
func Whitelist ¶
Whitelist compares IDs with the sender-id of the message or callback query. returns true if sender-id is in the blacklist.
func WithPrefix ¶
WithPrefix tests whether the update (message's text or caption, callback query, inline query) begins with prefix.
func WithSuffix ¶
WithPrefix tests whether the update (message's text or caption, callback query, inline query) ends with suffix.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func NewFilter ¶
func NewFilter(f FilterFunc) *Filter