From b9ad6ea08aafaaecec78b5d076b148ea1e1e1495 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 30 Aug 2017 13:43:43 -0700 Subject: [PATCH] work on bot service --- appservice.py | 3 +++ bot.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/appservice.py b/appservice.py index 96c8f00..c634f4f 100644 --- a/appservice.py +++ b/appservice.py @@ -153,6 +153,9 @@ def on_receive_events(transaction): addadminrm = MatrixAdminRooms(matrix_id=event['sender'], room_id=event['room_id']) db.session.add(addadminrm) db.session.commit() + else: + print(r.status_code) + print(r.text) elif event['content']['membership'] == 'invite': logging.info('>> GOT ROOM INVITE') diff --git a/bot.py b/bot.py index 82f2782..65c0eed 100644 --- a/bot.py +++ b/bot.py @@ -31,6 +31,13 @@ class MonkeyBot: logging.debug(rm) logging.debug(len(rooms)) + def on_invite(self, event): + + logging.info("<__on_invite__>") + logging.debug(event) + + room = self.client.join_room(event['room_id']) + def on_message(self, event): logging.info("<__on_message__>")