From dd430c090d91250f87944e2bed8b557f5f45a586 Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Thu, 5 Dec 2024 20:05:15 +0100 Subject: [PATCH] refactor(guild)!: remove deprecated get guild overload (#10052) BREAKING CHANGE: Removed `GuildsAPI#get` overload that allowed passing options as 2nd parameter --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- packages/core/src/api/guild.ts | 35 +++++----------------------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 4cb5414b3..41676f9f3 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -117,16 +117,6 @@ export interface CreateStickerOptions extends Omit): Promise; - /** * Fetches a guild * @@ -135,26 +125,11 @@ export class GuildsAPI { * @param query - The query options for fetching the guild * @param options - The options for fetching the guild */ - public async get( - guildId: Snowflake, - query?: RESTGetAPIGuildQuery, - options?: Pick, - ): Promise; - - public async get( - guildId: Snowflake, - queryOrOptions: Pick | RESTGetAPIGuildQuery = {}, - options: Pick = {}, - ) { - const requestData: RequestData = { - signal: ('signal' in queryOrOptions ? queryOrOptions : options).signal, - }; - - if ('with_counts' in queryOrOptions) { - requestData.query = makeURLSearchParams(queryOrOptions); - } - - return this.rest.get(Routes.guild(guildId), requestData) as Promise; + public async get(guildId: Snowflake, query: RESTGetAPIGuildQuery = {}, { signal }: Pick = {}) { + return this.rest.get(Routes.guild(guildId), { + query: makeURLSearchParams(query), + signal, + }) as Promise; } /**