diff --git a/helpers/guilds/getPruneCount.ts b/helpers/guilds/getPruneCount.ts index f24ca2bc4..896c75ed7 100644 --- a/helpers/guilds/getPruneCount.ts +++ b/helpers/guilds/getPruneCount.ts @@ -15,7 +15,7 @@ export async function getPruneCount(bot: Bot, guildId: bigint, options?: GetGuil if (options.days) url += `days=${options.days}`; if (options.includeRoles) url += `&include_roles=${options.includeRoles}`; } - + const result = await bot.rest.runMethod( bot.rest, "get", diff --git a/helpers/guilds/scheduledEvents/getScheduledEventUsers.ts b/helpers/guilds/scheduledEvents/getScheduledEventUsers.ts index 305e6ca50..21b9db842 100644 --- a/helpers/guilds/scheduledEvents/getScheduledEventUsers.ts +++ b/helpers/guilds/scheduledEvents/getScheduledEventUsers.ts @@ -23,21 +23,21 @@ export async function getScheduledEventUsers( ): Promise< Collection | Collection > { - let url = bot.constants.endpoints.GUILD_SCHEDULED_EVENT_USERS(guildId, eventId) + let url = bot.constants.endpoints.GUILD_SCHEDULED_EVENT_USERS(guildId, eventId); if (options) { - url = "?" + url = "?"; if (options.limit) url += `limit=${options.limit}`; - if (options.withMember) url += `&with_member=${options.withMember}` - if (options.after) url += `&after=${options.after}` - if (options.before) url += `&before=${options.before}` + if (options.withMember) url += `&with_member=${options.withMember}`; + if (options.after) url += `&after=${options.after}`; + if (options.before) url += `&before=${options.before}`; } - + const result = await bot.rest.runMethod<{ user: DiscordUser; member?: DiscordMember }[]>( bot.rest, "get", - url + url, ); if (!options?.withMember) { diff --git a/helpers/messages/getMessages.ts b/helpers/messages/getMessages.ts index ccae8323b..8c5e8f9f0 100644 --- a/helpers/messages/getMessages.ts +++ b/helpers/messages/getMessages.ts @@ -14,7 +14,7 @@ export async function getMessages( let url = bot.constants.endpoints.CHANNEL_MESSAGES(channelId); if (options) { - url += "?" + url += "?"; if (isGetMessagesAfter(options) && options.after) url += `after=${options.after}`; if (isGetMessagesBefore(options) && options.before) url += `&before=${options.before}`; if (isGetMessagesAround(options) && options.around) url += `&around=${options.around}`; @@ -24,7 +24,7 @@ export async function getMessages( const result = await bot.rest.runMethod( bot.rest, "get", - url + url, ); return await Promise.all(result.map((res) => bot.transformers.message(bot, res))); @@ -70,4 +70,4 @@ export function isGetMessagesAround(options: GetMessagesOptions): options is Get export function isGetMessagesLimit(options: GetMessagesOptions): options is GetMessagesLimit { return Reflect.has(options, "limit"); -} \ No newline at end of file +}