mirror of
https://github.com/paul-nameless/tg
synced 2025-02-18 03:28:23 +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]]:
|
def reply_markup(self) -> Optional[Dict[str, Any]]:
|
||||||
return self.msg.get("reply_markup")
|
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
|
@property
|
||||||
def chat_id(self) -> int:
|
def chat_id(self) -> int:
|
||||||
return self.msg["chat_id"]
|
return self.msg["chat_id"]
|
||||||
|
|
|
@ -390,7 +390,7 @@ class MsgView:
|
||||||
reply_markup = msg_proxy.reply_markup
|
reply_markup = msg_proxy.reply_markup
|
||||||
if not reply_markup:
|
if not reply_markup:
|
||||||
return msg
|
return msg
|
||||||
for row in reply_markup.get("rows", []):
|
for row in msg_proxy.reply_markup_rows:
|
||||||
msg += "\n"
|
msg += "\n"
|
||||||
for item in row:
|
for item in row:
|
||||||
text = item.get("text")
|
text = item.get("text")
|
||||||
|
|
Loading…
Add table
Reference in a new issue