Match Responses¶
There are some matched-based responses, which should normally come after a regexp trigger
-
class
MatchResponses¶ Regexp-based responses. These responses use the regexp match result from the trigger, as well as the given template, to build the response text.
-
message= <class 'gramhopper.responses.match_responses._MatchMessageResponse'>¶ A regexp-based message response. See more in
_MatchMessageResponse.
-
reply= <class 'gramhopper.responses.match_responses._MatchReplyResponse'>¶ A regexp-based reply response. See more in
_MatchReplyResponse.
-
match.message¶
-
class
_MatchMessageResponse(template: str, parse_mode: Optional[str] = None)¶ A regexp-based response in which the response method is a normal message
-
__init__(template: str, parse_mode: Optional[str] = None)¶ Constructs the response.
Parameters: - template – The template to use when building the response text
- parse_mode – Optional parse mode for the message. Read more in
telegram.ParseMode.
-
match.reply¶
-
class
_MatchReplyResponse(template: str, parse_mode: Optional[str] = None)¶ A regexp-based response in which the response method is a reply to the triggering message
-
__init__(template: str, parse_mode: Optional[str] = None)¶ Constructs the response.
Parameters: - template – The template to use when building the response text
- parse_mode – Optional parse mode for the message. Read more in
telegram.ParseMode.
-