2023-12-10 21:47:11 +01:00
|
|
|
import { GuildBasedChannel, GuildTextBasedChannel, Message } from 'discord.js';
|
2023-12-05 16:47:54 +01:00
|
|
|
import { GuildWrapper, InvokerWrapper, MemberWrapper, UserWrapper } from '../src/client/components/wrappers/index.ts';
|
|
|
|
import { CommandOption, Infraction } from '../src/client/interfaces/index.ts';
|
|
|
|
import { FormatParams, InfractionType } from './Client.ts';
|
|
|
|
|
2023-12-08 20:20:36 +01:00
|
|
|
export type ModerationTarget = UserWrapper | MemberWrapper | GuildTextBasedChannel
|
2023-12-05 16:47:54 +01:00
|
|
|
export type ModerationTargets = ModerationTarget[]
|
|
|
|
|
|
|
|
export type InfractionHandlerOptions = {
|
|
|
|
targets: ModerationTargets,
|
|
|
|
args: { [key: string]: CommandOption | undefined },
|
|
|
|
data?: object
|
|
|
|
}
|
|
|
|
|
|
|
|
export type HandleAutomodOptions = {
|
|
|
|
prune: boolean,
|
2023-12-08 20:20:36 +01:00
|
|
|
channel: GuildTextBasedChannel
|
2023-12-05 16:47:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export type HandleTargetData = {
|
|
|
|
reason?: string,
|
|
|
|
force: boolean,
|
|
|
|
guild: GuildWrapper,
|
|
|
|
points?: number | null,
|
|
|
|
expiration?: number | null,
|
|
|
|
invoker?: InvokerWrapper,
|
|
|
|
arguments?: { [key: string]: CommandOption | undefined },
|
2023-12-08 20:20:36 +01:00
|
|
|
channel: GuildTextBasedChannel,
|
2023-12-05 16:47:54 +01:00
|
|
|
executor: MemberWrapper,
|
|
|
|
duration?: number | null,
|
|
|
|
data: object,
|
|
|
|
silent: boolean,
|
|
|
|
}
|
|
|
|
|
|
|
|
export type EscalationResult = {
|
|
|
|
threshold: number,
|
|
|
|
type: InfractionType,
|
|
|
|
length: number
|
|
|
|
}
|
|
|
|
|
|
|
|
// export type AutomodAction = {
|
|
|
|
// points: number | undefined;
|
|
|
|
// expiration: number | undefined;
|
|
|
|
// prune: boolean;
|
|
|
|
// type: string,
|
|
|
|
// trigger: string | number,
|
|
|
|
// duration: number | null
|
|
|
|
// }
|
|
|
|
|
|
|
|
export type AutomodErrorProps = {
|
|
|
|
fatal: boolean,
|
|
|
|
reason: string,
|
|
|
|
infraction: Infraction
|
|
|
|
}
|
|
|
|
|
|
|
|
export type WordWatcherErrorProps = {
|
|
|
|
message: Message,
|
|
|
|
guild: GuildWrapper,
|
|
|
|
warning: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export type LogErrorProps = {
|
|
|
|
guild: GuildWrapper,
|
|
|
|
reason: string,
|
|
|
|
params: FormatParams,
|
|
|
|
logger: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type UtilityErrorProps = {
|
|
|
|
guild: GuildWrapper,
|
|
|
|
reason: string,
|
|
|
|
params: FormatParams,
|
|
|
|
utility: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type LinkFilterWarnProps = {
|
|
|
|
guild: GuildWrapper,
|
|
|
|
message: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MissingPermsProps = {
|
|
|
|
guild: GuildWrapper,
|
|
|
|
filter: string,
|
|
|
|
permissions: string[],
|
|
|
|
channel: GuildBasedChannel
|
|
|
|
}
|
|
|
|
|
|
|
|
export type InfractionEditResult = {
|
|
|
|
error: true,
|
|
|
|
index: string
|
2023-12-09 20:58:09 +01:00
|
|
|
} | undefined | void;
|