mirror of
https://github.com/paul-nameless/tg
synced 2024-11-25 13:20:25 +00:00
add tg msg method
This commit is contained in:
parent
c076fa621c
commit
f163e85880
2 changed files with 6 additions and 1 deletions
|
@ -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"]
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue