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

209 lines
4.5 KiB
TypeScript
Raw Permalink Normal View History

2023-12-05 16:47:54 +01:00
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,
RejoinSettings,
2023-12-05 16:47:54 +01:00
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
| RejoinSettings
2023-12-05 16:47:54 +01:00
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,
rejoin: RejoinSettings
2023-12-05 16:47:54 +01:00
}
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,
_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
}
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
}