Ejemplo n.º 1
0
 def get_message(self) -> Message or None:
     if self.chat_type == 'callback_query':
         return None
     return Message.de_json(self.message)
Ejemplo n.º 2
0
 def setUpClass(cls) -> None:
     jsonstring = r'{"message_id":1,"from":{"id":108929734,"first_name":"Frank","last_name":"Wang","username":"******","is_bot":true},"chat":{"id":1734,"first_name":"F","type":"private","last_name":"Wa","username":"******"},"date":1435296025,"text":"/start"}'
     cls.message = Message.de_json(jsonstring)
Ejemplo n.º 3
0
def fake_message(fake_message_dict):
    """Return a fake, minimalist Telegram message."""
    return Message.de_json(fake_message_dict)
Ejemplo n.º 4
0
def fake_message(fake_message_dict):
    """Return a fake, minimalist Telegram message."""
    return Message.de_json(fake_message_dict)