tweak payload for invite

This commit is contained in:
Morgan McMillian 2017-05-24 21:05:55 -07:00
parent 34973daf47
commit 43973232ab

View file

@ -78,11 +78,14 @@ class ChannelMonitor(threading.Thread):
def invite_room(self, user_id, roomid): def invite_room(self, user_id, roomid):
url = self.matrix_api_url + '/rooms/' + roomid + "/invite" url = self.matrix_api_url + '/rooms/' + roomid + "/invite"
headers = {"Content-Type": "application/json"}
params = { params = {
'access_token': self.matrix_api_token, 'access_token': self.matrix_api_token,
}
body = {
'user_id': user_id 'user_id': user_id
} }
r = requests.post(url, params=params) r = requests.post(url, headers=headers, params=params, data=json.dumps(body))
def send_message(self, roomid, msg): def send_message(self, roomid, msg):
url = self.matrix_api_url + '/rooms/' + roomid +'/send/m.room.message' + '/' + str(self.txId) url = self.matrix_api_url + '/rooms/' + roomid +'/send/m.room.message' + '/' + str(self.txId)