diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 9d75f163f..64c599383 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -11,6 +11,8 @@ import type { RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, + RESTGetAPIGuildBanResult, + RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, @@ -241,12 +243,32 @@ export class GuildsAPI { /** * Fetches a guild member ban * - * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans} + * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban} * @param guildId - The id of the guild to fetch the ban from - * @param options - The options for fetching the guild member ban + * @param userId - The id of the user to fetch the ban + * @param options - The options for fetching the ban */ - public async getMemberBans(guildId: Snowflake, { signal }: Pick = {}) { - return this.rest.get(Routes.guildBans(guildId), { signal }) as Promise; + public async getMemberBan(guildId: Snowflake, userId: Snowflake, { signal }: Pick = {}) { + return this.rest.get(Routes.guildBan(guildId, userId), { signal }) as Promise; + } + + /** + * Fetches guild member bans + * + * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans} + * @param guildId - The id of the guild to fetch the bans from + * @param query - The query options for fetching the bans + * @param options - The options for fetching the bans + */ + public async getMemberBans( + guildId: Snowflake, + query: RESTGetAPIGuildBansQuery = {}, + { signal }: Pick = {}, + ) { + return this.rest.get(Routes.guildBans(guildId), { + query: makeURLSearchParams(query), + signal, + }) as Promise; } /**