service: Refactor "get" command handle, make it robust when compact id has
patch 00e75e93c744727f1f30cb8e409d53b495c500ed
Author: E. Bosch <presidev@AT@gmail.com>
Date: Tue May 16 23:13:51 CEST 2023
* service: Refactor "get" command handle, make it robust when compact id has
not been initialized yet
hunk ./service.py 121
+ msg = None
hunk ./service.py 124
+ else: reply = ()
hunk ./service.py 127
- msg = await self.tg.telegram_client.get_messages(entity=peer_id, ids=id)
- if msg is None:
- reply = ('Message not found',)
- return reply
- await self.tg.handle_telegram_message(event=None, message=msg, history=True)
- reply = ()
+ if id is not None:
+ msg = await self.tg.telegram_client.get_messages(entity=peer_id, ids=id)
+ if msg is not None:
+ await self.tg.handle_telegram_message(event=None, message=msg, history=True)
+ else:
+ reply = ('Message not found',) [_$_]