add tg msg method

This commit is contained in:
lightme16 2020-10-10 17:06:10 +03:00
parent c076fa621c
commit f163e85880
2 changed files with 6 additions and 1 deletions

View file

@ -207,6 +207,11 @@ class MsgProxy:
def reply_markup(self) -> Optional[Dict[str, Any]]:
return self.msg.get("reply_markup")
@property
def reply_markup_rows(self) -> List[List[Dict[str, Any]]]:
assert self.reply_markup
return self.reply_markup.get("rows", [])
@property
def chat_id(self) -> int:
return self.msg["chat_id"]

View file

@ -390,7 +390,7 @@ class MsgView:
reply_markup = msg_proxy.reply_markup
if not reply_markup:
return msg
for row in reply_markup.get("rows", []):
for row in msg_proxy.reply_markup_rows:
msg += "\n"
for item in row:
text = item.get("text")