207 lines
4.4 KiB
TypeScript
207 lines
4.4 KiB
TypeScript
import { ChannelType, Snowflake } from 'discord.js';
|
|
import {
|
|
AutomodSettings,
|
|
AutoroleSettings,
|
|
CommandSettings,
|
|
DMInfractionSettings,
|
|
ErrorLogSettings,
|
|
GrantableSettings,
|
|
IgnoreSettings,
|
|
IndexingSettings,
|
|
InviteFilterSettings,
|
|
LinkfilterSettings,
|
|
LocaleSettings,
|
|
MemberLogSettings,
|
|
MentionFilterSettings,
|
|
MessagesSettings,
|
|
ModerationPointsSettings,
|
|
ModerationSettings,
|
|
MuteSettings,
|
|
NicknameLogSettings,
|
|
PermissionSettings,
|
|
ProtectionSettings,
|
|
RaidprotectionSettings,
|
|
SelfroleSettings,
|
|
SilenceSettings,
|
|
StaffSettings,
|
|
StickyRoleSettings,
|
|
TextCommandsSettings,
|
|
VoiceSettings,
|
|
WelcomerSettings,
|
|
WordFilterSettings,
|
|
WordWatcherSettings
|
|
} from './Settings.js';
|
|
import { ObjectId } from 'mongodb';
|
|
|
|
export type GuildSettingTypes =
|
|
| AutomodSettings
|
|
| AutoroleSettings
|
|
| CommandSettings
|
|
| DMInfractionSettings
|
|
| ErrorLogSettings
|
|
| GrantableSettings
|
|
| IgnoreSettings
|
|
| IndexingSettings
|
|
| InviteFilterSettings
|
|
| LinkfilterSettings
|
|
| MemberLogSettings
|
|
| MentionFilterSettings
|
|
| MessagesSettings
|
|
| ModerationPointsSettings
|
|
| ModerationSettings
|
|
| MuteSettings
|
|
| NicknameLogSettings
|
|
| PermissionSettings
|
|
| ProtectionSettings
|
|
| SelfroleSettings
|
|
| SilenceSettings
|
|
| StaffSettings
|
|
| StickyRoleSettings
|
|
| TextCommandsSettings
|
|
| VoiceSettings
|
|
| WelcomerSettings
|
|
| WordFilterSettings
|
|
| WordWatcherSettings
|
|
| LocaleSettings
|
|
|
|
export type PartialGuildSettings = Partial<GuildSettings>
|
|
// {
|
|
// [key: string]: unknown
|
|
// }
|
|
|
|
export type GuildSettings = {
|
|
[key: string]: GuildSettingTypes,
|
|
locale: LocaleSettings,
|
|
textcommands: TextCommandsSettings,
|
|
wordfilter: WordFilterSettings
|
|
moderation: ModerationSettings,
|
|
dminfraction: DMInfractionSettings,
|
|
protection: ProtectionSettings,
|
|
modpoints: ModerationPointsSettings,
|
|
automod: AutomodSettings,
|
|
permissions: PermissionSettings,
|
|
grantable: GrantableSettings,
|
|
mute: MuteSettings,
|
|
silent: SilenceSettings,
|
|
ignore: IgnoreSettings,
|
|
commands: CommandSettings,
|
|
indexing: IndexingSettings,
|
|
errors: ErrorLogSettings,
|
|
messages: MessagesSettings,
|
|
staff: StaffSettings,
|
|
voice: VoiceSettings,
|
|
selfrole: SelfroleSettings,
|
|
members: MemberLogSettings,
|
|
nicknames: NicknameLogSettings,
|
|
stickyrole: StickyRoleSettings,
|
|
autorole: AutoroleSettings,
|
|
welcomer: WelcomerSettings,
|
|
wordwatcher: WordWatcherSettings,
|
|
linkfilter: LinkfilterSettings,
|
|
invitefilter: InviteFilterSettings,
|
|
mentionfilter: MentionFilterSettings,
|
|
raidprotection: RaidprotectionSettings,
|
|
}
|
|
|
|
export type PermissionSet = {
|
|
global: string[],
|
|
channels: {
|
|
[id: Snowflake]: string[]
|
|
}
|
|
}
|
|
|
|
export type GuildPermissions = {
|
|
guildId: Snowflake,
|
|
[roleId: Snowflake]: PermissionSet | Snowflake
|
|
}
|
|
|
|
export type GuildData = {
|
|
[key: string]: unknown
|
|
caseId?: number,
|
|
settings?: GuildSettings,
|
|
premium?: number,
|
|
debug?: boolean,
|
|
_version?: string,
|
|
_imported?: {
|
|
[key: string]: boolean | undefined,
|
|
modlogs?: boolean,
|
|
settings?: boolean
|
|
}
|
|
}
|
|
|
|
export type CallbackData = {
|
|
type: string,
|
|
created: number,
|
|
time: number,
|
|
id: string
|
|
}
|
|
|
|
export type PollData = {
|
|
user: string,
|
|
duration: number,
|
|
message: string,
|
|
channel: string,
|
|
startedIn: string,
|
|
questions: string[],
|
|
multiChoice?: boolean
|
|
}
|
|
|
|
export type ReminderData = {
|
|
user: string,
|
|
channel: string,
|
|
reminder: string,
|
|
time: number // In seconds
|
|
}
|
|
|
|
export type ChannelJSON = {
|
|
id: Snowflake,
|
|
type: ChannelType,
|
|
name: string,
|
|
parent: Snowflake | null
|
|
}
|
|
|
|
export type RoleJSON = {
|
|
id: Snowflake,
|
|
name: string,
|
|
position: number,
|
|
}
|
|
|
|
export type GuildJSON = {
|
|
channels: ChannelJSON[],
|
|
roles: RoleJSON[]
|
|
}
|
|
|
|
export type AttachmentData = {
|
|
size: number,
|
|
attachmentId: string,
|
|
name: string,
|
|
index: ObjectId,
|
|
id: string,
|
|
extension: string,
|
|
buffer: { buffer: Buffer }
|
|
}
|
|
|
|
export type MessageLogEntry = {
|
|
attachments: AttachmentData[]
|
|
}
|
|
|
|
export type RoleCacheEntry = {
|
|
member: string,
|
|
guild: string,
|
|
roles: string[],
|
|
timestamp: number
|
|
}
|
|
|
|
export type WordWatcherEntry = {
|
|
message: string,
|
|
target: string,
|
|
channel: string,
|
|
timestamp: number
|
|
}
|
|
|
|
export type WebhookEntry = {
|
|
feature: string,
|
|
guild: string,
|
|
hookId: string,
|
|
token: string
|
|
} |