mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
add webhooks v8 (#759)
* add webhook structure and getChannelWebhooks as well as getServerWebhooks * add sendMessage * add the ability to edit create and delete hooks * remove server wide cache and add getter.
This commit is contained in:
@@ -64,6 +64,9 @@ var Endpoints = Constants.Endpoints = {
|
||||
SERVER_CHANNELS: function SERVER_CHANNELS(serverID) {
|
||||
return Endpoints.SERVER(serverID) + "/channels";
|
||||
},
|
||||
SERVER_WEBHOOKS: function SERVER_WEBHOOKS(serverID) {
|
||||
return Endpoints.SERVER(serverID) + "/webhooks";
|
||||
},
|
||||
|
||||
// channels
|
||||
CHANNELS: API + "/channels",
|
||||
@@ -91,6 +94,24 @@ var Endpoints = Constants.Endpoints = {
|
||||
CHANNEL_PIN: function CHANNEL_PIN(channelID, messageID) {
|
||||
return Endpoints.CHANNEL_PINS(channelID) + "/" + messageID;
|
||||
},
|
||||
CHANNEL_WEBHOOKS: function CHANNEL_WEBHOOKS(channelID) {
|
||||
return Endpoints.CHANNEL(channelID) + "/webhooks";
|
||||
},
|
||||
|
||||
// webhooks
|
||||
WEBHOOKS: API + "/webhooks",
|
||||
WEBHOOK: function WEBHOOK(webhookID) {
|
||||
return Endpoints.WEBHOOKS + "/" + webhookID;
|
||||
},
|
||||
WEBHOOK_WITH_TOKEN: function WEBHOOK_WITH_TOKEN(webhookID, webhookToken) {
|
||||
return Endpoints.WEBHOOKS + "/" + webhookToken;
|
||||
},
|
||||
WEBHOOK_MESSAGE: function WEBHOOK_MESSAGE(webhookID, webhookToken) {
|
||||
return Endpoints.WEBHOOK(webhookID) + "/" + webhookToken;
|
||||
},
|
||||
WEBHOOK_MESSAGE_SLACK: function WEBHOOK_MESSAGE_SLACK(webhookID, webhookToken) {
|
||||
return Endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken) + "/slack";
|
||||
},
|
||||
|
||||
// friends
|
||||
FRIENDS: API + "/users/@me/relationships"
|
||||
|
||||
Reference in New Issue
Block a user