2024-07-26 15:26:42 +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-05 16:47:54 +01:00
|
|
|
import { Snowflake } from 'discord.js';
|
|
|
|
import { InfractionType, SettingAction } from './Client.js';
|
|
|
|
|
|
|
|
export type UserSettings = {
|
|
|
|
prefix?: string,
|
|
|
|
locale?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Setting = {
|
2024-07-26 15:26:42 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2023-12-05 16:47:54 +01:00
|
|
|
[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,
|
2024-01-24 22:00:19 +01:00
|
|
|
enabled: boolean,
|
|
|
|
autolog: boolean,
|
2023-12-05 16:47:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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 = {
|
2024-07-26 15:26:42 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2023-12-05 16:47:54 +01:00
|
|
|
[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
|
2023-12-08 19:23:22 +01:00
|
|
|
|
2023-12-05 16:47:54 +01:00
|
|
|
export type StickyRoleSettings = {
|
|
|
|
roles: string[]
|
|
|
|
} & Setting
|
|
|
|
|
|
|
|
export type AutoroleSettings = {
|
|
|
|
roles: string[]
|
|
|
|
} & Setting
|
|
|
|
|
|
|
|
export type WelcomerSettings = {
|
|
|
|
message: string | null
|
|
|
|
} & Setting
|
|
|
|
|
|
|
|
export type WordWatcherSettings = {
|
2024-07-26 15:26:42 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2023-12-05 16:47:54 +01:00
|
|
|
[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
|