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

107 lines
2.9 KiB
TypeScript

// 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/>.
import { GuildBasedChannel, GuildTextBasedChannel, Message } 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 | GuildTextBasedChannel
export type ModerationTargets = ModerationTarget[]
export type InfractionHandlerOptions = {
targets: ModerationTargets,
args: { [key: string]: CommandOption | undefined },
data?: object
}
export type HandleAutomodOptions = {
prune: boolean,
channel: GuildTextBasedChannel
}
export type HandleTargetData = {
reason?: string,
force: boolean,
guild: GuildWrapper,
points?: number | null,
expiration?: number | null,
invoker?: InvokerWrapper,
arguments?: { [key: string]: CommandOption | undefined },
channel: GuildTextBasedChannel,
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 | void;