mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix getPruneCounts query string params (#2211)
* fix getPruneCounts query string params * Apply suggestions from code review Co-authored-by: ITOH <to@itoh.at> Co-authored-by: ITOH <to@itoh.at> Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
co-authored by
ITOH
Skillz4Killz
parent
2a330173d5
commit
a72ded7615
@@ -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 */
|
/** 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) {
|
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 < 1) throw new Error(bot.constants.Errors.PRUNE_MIN_DAYS);
|
||||||
if (options?.days && options.days > 30) {
|
if (options?.days && options.days > 30) throw new Error(bot.constants.Errors.PRUNE_MAX_DAYS);
|
||||||
throw new Error(bot.constants.Errors.PRUNE_MAX_DAYS);
|
|
||||||
}
|
|
||||||
|
|
||||||
let url = bot.constants.endpoints.GUILD_PRUNE(guildId);
|
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 */
|
/** Number of days to count prune for (1 or more), default: 7 */
|
||||||
days?: number;
|
days?: number;
|
||||||
/** Role(s) to include, default: none */
|
/** Role(s) to include, default: none */
|
||||||
includeRoles: string | string[];
|
includeRoles?: string | string[];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user