def get_message(self) -> Message or None: if self.chat_type == 'callback_query': return None return Message.de_json(self.message)
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)
def fake_message(fake_message_dict): """Return a fake, minimalist Telegram message.""" return Message.de_json(fake_message_dict)
def fake_message(fake_message_dict): """Return a fake, minimalist Telegram message.""" return Message.de_json(fake_message_dict)