BREAKING: Rename getWebhooks to getGuildWebhooks (#2465)

* rename getWebhooks to getGuildWebhooks
move getChannelWebhooks from `helpers/channels` to `helpers/webhooks`

* helpers/webhooks: getWebhook -> getGuildWebhooks

* tests: fix webhook test

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
LTS20050703
2022-10-07 16:08:36 -05:00
committed by GitHub
co-authored by Skillz4Killz
parent 1da3ffa6d2
commit a0f130db50
5 changed files with 4 additions and 4 deletions
-1
View File
@@ -11,6 +11,5 @@ export * from "./editChannelPermissionOverrides.ts";
export * from "./getChannel.ts";
export * from "./getChannelInvites.ts";
export * from "./getChannels.ts";
export * from "./getChannelWebhooks.ts";
export * from "./triggerTypingIndicator.ts";
export * from "./editChannelPositions.ts";
@@ -16,7 +16,7 @@ import { Collection } from "../../util/collection.ts";
*
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
*/
export async function getWebhooks(bot: Bot, guildId: BigString): Promise<Collection<bigint, Webhook>> {
export async function getGuildWebhooks(bot: Bot, guildId: BigString): Promise<Collection<bigint, Webhook>> {
const results = await bot.rest.runMethod<DiscordWebhook[]>(
bot.rest,
"GET",
+2 -1
View File
@@ -7,7 +7,8 @@ export * from "./editWebhook.ts";
export * from "./editWebhookMessage.ts";
export * from "./editWebhookWithToken.ts";
export * from "./executeWebhook.ts";
export * from "./getChannelWebhooks.ts";
export * from "./getGuildWebhooks.ts";
export * from "./getWebhook.ts";
export * from "./getWebhookMessage.ts";
export * from "./getWebhooks.ts";
export * from "./getWebhookWithToken.ts";
+1 -1
View File
@@ -53,7 +53,7 @@ Deno.test("[webhooks] Webhook related tests", async (t) => {
assertEquals(fetched.size > 1, true);
await t.step("[webhooks] Get guild webhooks", async () => {
const guildWebhooks = await bot.helpers.getWebhooks(channel.guildId);
const guildWebhooks = await bot.helpers.getGuildWebhooks(channel.guildId);
assertEquals(guildWebhooks.size > 1, true);
});
});