mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
added an easier way to get frequent commands from message.
This commit is contained in:
parent
5b8f41b3c1
commit
69aa1c252b
1 changed files with 6 additions and 0 deletions
|
@ -171,6 +171,12 @@ class Message(TelegramObject):
|
|||
|
||||
return Message(**data)
|
||||
|
||||
def __getitem__(self, item):
|
||||
if item in self.__dict__.keys():
|
||||
return self.__dict__[item]
|
||||
elif item == 'chat_id':
|
||||
return self.chat.id
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns:
|
||||
|
|
Loading…
Reference in a new issue