2024-07-18 19:06:49 +02:00
|
|
|
// Galactic - Discord moderation bot
|
|
|
|
// Copyright (C) 2024 Navy.gif
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
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;
|