refactor(util): update endpoints (#383)

* Update constants.ts

* fiiiixxxx

* dupe

* Update src/util/constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* USER_DM

* fix this and remove that

* Update src/util/constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update constants.ts

* Update src/util/constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* need these

* hmm

* rename GUILD_EMBED to GUILD_WIDGET

* idk

* Update src/util/constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update constants.ts

* Update constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>
This commit is contained in:
ITOH
2021-01-17 17:34:34 +01:00
committed by GitHub
parent b4cfeb7fbd
commit 8b663ca4de
5 changed files with 122 additions and 99 deletions
+3 -3
View File
@@ -1,4 +1,5 @@
import { botID } from "../../bot.ts";
import { RequestManager } from "../../rest/request_manager.ts";
import {
CreateSlashCommandOptions,
EditSlashCommandOptions,
@@ -17,7 +18,6 @@ import { endpoints } from "../../util/constants.ts";
import { botHasChannelPermissions } from "../../util/permissions.ts";
import { urlToBase64 } from "../../util/utils.ts";
import { structures } from "../structures/mod.ts";
import { RequestManager } from "../../rest/request_manager.ts";
/** Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:
*
@@ -166,7 +166,7 @@ export function editWebhookMessage(
}
return RequestManager.patch(
endpoints.WEBHOOK_EDIT(webhookID, webhookToken, messageID),
endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken, messageID),
{ ...options, allowed_mentions: options.allowed_mentions },
);
}
@@ -177,7 +177,7 @@ export function deleteWebhookMessage(
messageID: string,
) {
return RequestManager.delete(
endpoints.WEBHOOK_DELETE(webhookID, webhookToken, messageID),
endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken, messageID),
);
}