add webhook#sendSlackMessage (#788)

This commit is contained in:
Gus Caplan
2016-10-10 00:56:18 -05:00
committed by Schuyler Cebulskie
parent 9230b8866b
commit e48d7d52f1
3 changed files with 38 additions and 4 deletions

View File

@@ -613,6 +613,19 @@ class RESTMethods {
}).catch(reject);
});
}
sendSlackWebhookMessage(webhook, body) {
return new Promise((resolve, reject) => {
this.rest.makeRequest(
'post',
`${Constants.Endpoints.webhook(webhook.id, webhook.token)}/slack?wait=true`,
false,
body
).then(data => {
resolve(data);
}).catch(reject);
});
}
}
module.exports = RESTMethods;