galactic-bot/@types/Moderation.d.ts

91 lines
2.1 KiB
TypeScript
Raw Normal View History

2023-12-05 16:47:54 +01:00
import { GuildBasedChannel, Message, TextChannel } from 'discord.js';
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';
export type ModerationTarget = UserWrapper | MemberWrapper | TextChannel
export type ModerationTargets = ModerationTarget[]
export type InfractionHandlerOptions = {
targets: ModerationTargets,
args: { [key: string]: CommandOption | undefined },
data?: object
}
export type HandleAutomodOptions = {
prune: boolean,
channel: TextChannel
}
export type HandleTargetData = {
reason?: string,
force: boolean,
guild: GuildWrapper,
points?: number | null,
expiration?: number | null,
invoker?: InvokerWrapper,
arguments?: { [key: string]: CommandOption | undefined },
channel: TextChannel,
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
} | undefined;