predicates Module

predicates Module

class predicates.Filters[source]

Bases: object

Filters used to call plugin methods when particular types of messages are received.

For usage, see description of the BeardChatHandler.__commands__ variable.

classmethod document(chat_handler, msg)[source]

Filters for sent documents

classmethod location(chat_handler, msg)[source]

Filters for sent locations

classmethod photo(chat_handler, msg)[source]

Filters for sent locations

classmethod text(chat_handler, msg)[source]

Filters for text messages

classmethod text_no_cmd(chat_handler, msg)[source]

Filters for text messages that don’t start with a bot command

predicates.command_predicate(cmd)[source]

Returns a predicate coroutine which returns True if command is sent.

predicates.regex_predicate(pattern, lower=False)[source]

Returns a predicate function which returns True if pattern is matched. if lower == True, the text will be made lower case.