From a72ded761523f5a218f3702f7e55037ed3770972 Mon Sep 17 00:00:00 2001 From: LTS20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 13 May 2022 01:18:36 +0700 Subject: [PATCH] fix getPruneCounts query string params (#2211) * fix getPruneCounts query string params * Apply suggestions from code review Co-authored-by: ITOH Co-authored-by: ITOH Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> --- helpers/guilds/getPruneCount.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/helpers/guilds/getPruneCount.ts b/helpers/guilds/getPruneCount.ts index 896c75ed7..c1add1883 100644 --- a/helpers/guilds/getPruneCount.ts +++ b/helpers/guilds/getPruneCount.ts @@ -3,9 +3,7 @@ import type { Bot } from "../../bot.ts"; /** Check how many members would be removed from the server in a prune operation. Requires the KICK_MEMBERS permission */ export async function getPruneCount(bot: Bot, guildId: bigint, options?: GetGuildPruneCountQuery) { if (options?.days && options.days < 1) throw new Error(bot.constants.Errors.PRUNE_MIN_DAYS); - if (options?.days && options.days > 30) { - throw new Error(bot.constants.Errors.PRUNE_MAX_DAYS); - } + if (options?.days && options.days > 30) throw new Error(bot.constants.Errors.PRUNE_MAX_DAYS); let url = bot.constants.endpoints.GUILD_PRUNE(guildId); @@ -30,5 +28,5 @@ export interface GetGuildPruneCountQuery { /** Number of days to count prune for (1 or more), default: 7 */ days?: number; /** Role(s) to include, default: none */ - includeRoles: string | string[]; + includeRoles?: string | string[]; }