Skip to content

Commit

Permalink
fix(guild): allow to pass query into get
Browse files Browse the repository at this point in the history
  • Loading branch information
jaw0r3k committed Dec 14, 2023
1 parent adfd9cd commit 7927e93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/api/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
type RESTGetAPIGuildPreviewResult,
type RESTGetAPIGuildPruneCountQuery,
type RESTGetAPIGuildPruneCountResult,
type RESTGetAPIGuildQuery,
type RESTGetAPIGuildResult,
type RESTGetAPIGuildRolesResult,
type RESTGetAPIGuildScheduledEventQuery,
Expand Down Expand Up @@ -110,8 +111,11 @@ export class GuildsAPI {
* @param guildId - The id of the guild
* @param options - The options for fetching the guild
*/
public async get(guildId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.guild(guildId), { signal }) as Promise<RESTGetAPIGuildResult>;
public async get(guildId: Snowflake, query: RESTGetAPIGuildQuery = {}, { signal }: Pick<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.guild(guildId), {
query: makeURLSearchParams(query),
signal,
}) as Promise<RESTGetAPIGuildResult>;
}

/**
Expand Down

0 comments on commit 7927e93

Please sign in to comment.