From 69aa1c252bced9931e374cf6bd8b955abc387f4f Mon Sep 17 00:00:00 2001 From: mattijn Date: Mon, 7 Sep 2015 04:55:00 +0200 Subject: [PATCH] added an easier way to get frequent commands from message. --- telegram/message.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telegram/message.py b/telegram/message.py index 1caf61dc7..e77f3ea4b 100644 --- a/telegram/message.py +++ b/telegram/message.py @@ -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: