// 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 . import { Snowflake } from 'discord.js'; import { InfractionType, SettingAction } from './Client.js'; export type Setting = { // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any enabled: boolean } export type TextCommandsSettings = { prefix: string, } & Setting export type FilterSetting = { bypass: string[], whitelist: string[], ignore: string[], silent: boolean, actions: SettingAction[] } & Setting export type WordFilterSettings = { explicit: string[], fuzzy: string[], regex: string[], } & FilterSetting export type ModerationSettings = { channel: Snowflake | null, infractions: InfractionType[], anonymous: boolean, enabled: boolean, autolog: boolean, } export type DMInfractionSettings = { anonymous: boolean, infractions: InfractionType[], messages: { [key: string]: string } } & Setting export type ProtectionType = 'position' | 'role' export type ProtectionSettings = { type: ProtectionType, roles: Snowflake[] } & Setting export type ModerationPointsSettings = { points: { [key in InfractionType]: number }, expirations: { [key in InfractionType]: number }, associations: { [key: string]: number }, multiplier: boolean } & Setting export type AutomodSettings = { usePrevious: boolean; thresholds: { [key: number]: { type?: InfractionType, length?: number } }, } & Setting export type PermissionType = 'discord' | 'grant' | 'both'; export type PermissionSettings = { type: PermissionType } export type GrantableSettings = { roles: Snowflake[] } & Setting // export type MuteType = 1 | 2 | 3; export enum MuteType { Add = 0, Replace = 1, Remove = 2, Timeout = 3 } export type MuteSettings = { // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any// MuteType | Snowflake | number | boolean | null type: MuteType, role: Snowflake | null, permanent: boolean, default: number, } export type SilenceSettings = { // } & Setting export type IgnoreSettings = { [key: string]: Snowflake[] channels: Snowflake[], bypass: Snowflake[] } export type CommandSettings = { disabled: string[], custom: object } export type IndexingSettings = { description: string | null } & Setting export type ErrorLogSettings = { types: string[] channel: string | null } export type MessagesSettings = { channel: string | null, bypass: string[], ignore: string[], attachments: boolean, webhook: string | null, } & Setting export type StaffSettings = { role: string | null, rule: string | null } & Setting export type VoiceSettings = { channel: string | null } & Setting export type SelfroleSettings = { text: string | null, roles: string[], message: string | null, channel: string | null, } export type MemberLogSettings = { channel: string | null, join: string | null, leave: string | null } & Setting export type NicknameLogSettings = { channel: string | null } & Setting export type StickyRoleSettings = { roles: string[] } & Setting export type AutoroleSettings = { roles: string[] } & Setting export type WelcomerSettings = { message: string | null } & Setting export type WordWatcherSettings = { // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any// SettingAction[] | string[] | string | null words: string[], regex: string[], bypass: string[], ignore: string[], channel: string | null, actions: SettingAction[] } export type LinkfilterSettings = { blacklist: string[], greylist: string[] whitelistMode: boolean, } & FilterSetting export type InviteFilterSettings = { // } & FilterSetting export type MentionFilterSettings = { unique: boolean, limit: number } & FilterSetting export type LocaleSettings = { language: string } export type RaidprotectionSettings = { // } & Setting