Initial commit.

This commit is contained in:
Tarrgon
2025-05-28 10:44:41 -04:00
commit e0efb86dce
50 changed files with 8579 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import { Client, ContextMenuCommandBuilder, SlashCommandBuilder } from 'discord.js';
import { Handler } from './handler';
export type CommandBuilder = ContextMenuCommandBuilder | SlashCommandBuilder;
export interface Command extends Handler {
data: CommandBuilder | ((client: Client) => Promise<CommandBuilder>);
guilds?: string[];
}
+33
View File
@@ -0,0 +1,33 @@
export type LoggedMessage = {
id: string
author_id: string
author_name: string
channel_id: string
attachments: string
stickers: string
content: string
}
export type GuildSettings = {
guild_id: string
general_chat_id?: string
new_member_channel_id?: string
tickets_channel_id?: string
event_logs_channel_id?: string
audit_logs_channel_id?: string
voice_logs_channel_id?: string
admin_role_id?: string
private_help_role_id?: string
staff_categories?: string
}
export type TicketMessage = {
id: number
message_id: string
}
export type TicketPhrase = {
id: number
user_id: string
phrase: string
}
+128
View File
@@ -0,0 +1,128 @@
export type E621User = {
wiki_page_version_count: number
artist_version_count: number
pool_version_count: number
forum_post_count: number
comment_count: number
flag_count: number
favorite_count: number
positive_feedback_count: number
neutral_feedback_count: number
negative_feedback_count: number
upload_limit: number
profile_about: string
profile_artinfo: string
id: number
created_at: string
name: string
level: number
base_upload_limit: number
post_upload_count: number
post_update_count: number
note_update_count: number
is_banned: boolean
can_approve_posts: boolean
can_upload_free: boolean
level_string: string
avatar_id: number
}
export type E621Post = {
id: number
created_at: string
updated_at: string
file: E621File
preview: E621PreviewFile
sample: E621SampleFile
score: E621ScoreData
tags: E621Tags
locked_tags: string[]
change_seq: number
flags: E621FlagData
rating: 's' | 'q' | 'e'
fav_count: number
sources: string[]
pools: number[]
relationships: E621PostRelationships
approver_id: number
uploader_id: number
description: string
comment_count: number
is_favorited: boolean
has_notes: boolean
duration: number | null
}
export type E621File = {
width: number
height: number
ext: 'png' | 'jpg' | 'mp4' | 'webm'
size: number
md5: string
url: string | null
}
export type E621PreviewFile = {
width: number
height: number
url: string | null
}
export type E621SampleFile = {
has: boolean
height: number
width: number
url: string | null
// Typing this will be a pain in the ass, so I skipped it for now.
alternates: any
}
export type E621ScoreData = {
up: number
down: number
total: number
}
export type E621Tags = {
general: string[]
artist: string[]
contributor: string[]
copyright: string[]
character: string[]
species: string[]
invalid: string[]
meta: string[]
lore: string[]
}
export type E621FlagData = {
pending: boolean
flagged: boolean
note_locked: boolean
status_locked: boolean
rating_locked: boolean
deleted: boolean
}
export type E621PostRelationships = {
parent_id: number | null
has_children: boolean
has_active_children: boolean
children: number[]
}
export type Ticket = {
id: number
user_id: number
user: string
claimant: string | null
target?: string
status: 'pending' | 'partial' | 'approved'
category: 'blip' | 'comment' | 'dmail' | 'forum' | 'pool' | 'post' | 'set' | 'user' | 'wiki'
reason: 'string'
};
export type TicketUpdate = {
action: 'claim' | 'create' | 'unclaim' | 'update'
ticket: Ticket
};
+10
View File
@@ -0,0 +1,10 @@
import { Client, Interaction } from 'discord.js';
type HandlerFunction = (client: Client, interaction: Interaction, ...args: any) => Promise<void>
export interface Handler {
name: string;
handler: HandlerFunction;
init?: (client: Client) => Promise<void>;
autoComplete?: HandlerFunction;
}
+24
View File
@@ -0,0 +1,24 @@
import { APIRole, PermissionsBitField, TextChannel } from 'discord.js';
export type RoleChangeLog = {
key: '$add' | '$remove',
old?: Pick<APIRole, 'id' | 'name'>[],
new?: Pick<APIRole, 'id' | 'name'>[]
}
export type TimeoutChangeLog = {
key: 'communication_disabled_until',
old?: string,
new?: string
}
export type PermissionsChangeLog = {
key: 'permissions' | 'allow' | 'deny',
old?: number,
new?: number
}
export type PinExtras = {
channel: TextChannel,
messageId: string
}
+5
View File
@@ -0,0 +1,5 @@
export * from './command';
export * from './e621-types';
export * from './handler';
export * from './helper-types';
export * from './database-types';