mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
add webhook#sendSlackMessage (#788)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
9230b8866b
commit
e48d7d52f1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user