mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(core): Adds getWebhooks() function for the channel API and for the guild API (#9043)
* feat(core): Adds `getChannel()` for webhooks * feat(core): add `getWebhooks()` function for the channel and the guild * Update packages/core/src/api/guild.ts Co-authored-by: Almeida <almeidx@pm.me> * Update packages/core/src/api/channel.ts Co-authored-by: Almeida <almeidx@pm.me> * Update packages/core/src/api/channel.ts Co-authored-by: Almeida <almeidx@pm.me> * Update packages/core/src/api/guild.ts Co-authored-by: Almeida <almeidx@pm.me> * Update packages/core/src/api/guild.ts Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * Update packages/core/src/api/channel.ts Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * sorting the types --------- Co-authored-by: Almeida <almeidx@pm.me> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: space <spaceeec@yahoo.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
type RESTPostAPIGuildStickerFormDataBody,
|
||||
type RESTPostAPIGuildStickerResult,
|
||||
type RESTGetAPIGuildMembersSearchQuery,
|
||||
type RESTGetAPIGuildWebhooksResult,
|
||||
type RESTGetAPIGuildWelcomeScreenResult,
|
||||
type RESTGetAPIGuildWidgetImageResult,
|
||||
type RESTGetAPIGuildWidgetJSONResult,
|
||||
@@ -965,4 +966,14 @@ export class GuildsAPI {
|
||||
public async createTemplate(templateCode: string, data: RESTPostAPITemplateCreateGuildJSONBody) {
|
||||
return this.rest.post(Routes.template(templateCode), { body: data }) as Promise<RESTPostAPIGuildTemplatesResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches webhooks for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
|
||||
* @param id - The id of the guild
|
||||
*/
|
||||
public async getWebhooks(id: Snowflake) {
|
||||
return this.rest.get(Routes.guildWebhooks(id)) as Promise<RESTGetAPIGuildWebhooksResult>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user