mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 09:20:08 +00:00
fix ban
This commit is contained in:
@@ -299,7 +299,7 @@ export async function getPruneCount(guildID: string, options: PruneOptions) {
|
||||
|
||||
const result = await RequestManager.get(
|
||||
endpoints.GUILD_PRUNE(guildID),
|
||||
options,
|
||||
{ ...options, include_roles: options.roles.join(",") },
|
||||
) as PrunePayload;
|
||||
|
||||
return result.pruned;
|
||||
@@ -316,7 +316,10 @@ export function pruneMembers(guildID: string, options: PruneOptions) {
|
||||
throw new Error(Errors.MISSING_KICK_MEMBERS);
|
||||
}
|
||||
|
||||
RequestManager.post(endpoints.GUILD_PRUNE(guildID), options);
|
||||
RequestManager.post(
|
||||
endpoints.GUILD_PRUNE(guildID),
|
||||
{ ...options, include_roles: options.roles.join(",") },
|
||||
);
|
||||
}
|
||||
|
||||
export function fetchMembers(guild: Guild, options?: FetchMembersOptions) {
|
||||
@@ -440,7 +443,7 @@ export function ban(guildID: string, id: string, options: BanOptions) {
|
||||
throw new Error(Errors.MISSING_BAN_MEMBERS);
|
||||
}
|
||||
|
||||
return RequestManager.put(endpoints.GUILD_BAN(guildID, id), options);
|
||||
return RequestManager.put(endpoints.GUILD_BAN(guildID, id), { ...options, delete_message_days: options.days });
|
||||
}
|
||||
|
||||
/** Remove the ban for a user. REquires BAN_MEMBERS permission */
|
||||
|
||||
@@ -190,7 +190,7 @@ export interface Voice_Region {
|
||||
|
||||
export interface BanOptions {
|
||||
/** number of days to delete messages for (0-7) */
|
||||
delete_message_days?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
days?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
/** The reason for the ban. */
|
||||
reason?: string;
|
||||
}
|
||||
@@ -528,8 +528,8 @@ export interface PrunePayload {
|
||||
export interface PruneOptions {
|
||||
/** number of days to count prune for (1 or more). Defaults to 7 days. */
|
||||
days: number;
|
||||
/** comma-delimited array of role ids */
|
||||
include_roles: string;
|
||||
/** Include members with these role ids */
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface Voice_State {
|
||||
|
||||
Reference in New Issue
Block a user