diff --git a/bot1/chats.py b/bot1/chats.py index 3ded811..e87b240 100644 --- a/bot1/chats.py +++ b/bot1/chats.py @@ -98,8 +98,11 @@ class BaseChat(SaveFileObject): def inline(self,query): pass + def log_update(self, update): + with open("chat_logs/%s.yaml" % self.id,"a+") as f: + f.write(yaml.safe_dump([update.to_array()])) def process_update(self,update): - + self.log_update(update) if update.inline_query: return self.inline(update.inline_query) self.last_message_id=get_message_id(update)