work on bot service

This commit is contained in:
Morgan McMillian 2017-08-30 13:43:43 -07:00
parent 5ba5765435
commit b9ad6ea08a
2 changed files with 10 additions and 0 deletions

View file

@ -153,6 +153,9 @@ def on_receive_events(transaction):
addadminrm = MatrixAdminRooms(matrix_id=event['sender'], room_id=event['room_id']) addadminrm = MatrixAdminRooms(matrix_id=event['sender'], room_id=event['room_id'])
db.session.add(addadminrm) db.session.add(addadminrm)
db.session.commit() db.session.commit()
else:
print(r.status_code)
print(r.text)
elif event['content']['membership'] == 'invite': elif event['content']['membership'] == 'invite':
logging.info('>> GOT ROOM INVITE') logging.info('>> GOT ROOM INVITE')

7
bot.py
View file

@ -31,6 +31,13 @@ class MonkeyBot:
logging.debug(rm) logging.debug(rm)
logging.debug(len(rooms)) 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): def on_message(self, event):
logging.info("<__on_message__>") logging.info("<__on_message__>")