Converted main codebase to typescript
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
8
src/interfaces/Autocomplete.ts
Normal file
8
src/interfaces/Autocomplete.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { AutocompleteInteraction } from "discord.js"
|
||||
|
||||
export default interface Autocomplete {
|
||||
name: string
|
||||
description: string
|
||||
type: "autocomplete"
|
||||
execute: (interaction: AutocompleteInteraction) => Promise<void>
|
||||
}
|
||||
8
src/interfaces/Button.ts
Normal file
8
src/interfaces/Button.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ButtonInteraction } from "discord.js"
|
||||
|
||||
export default interface Button {
|
||||
name: string
|
||||
description: string
|
||||
type: "button"
|
||||
execute: (interaction: ButtonInteraction) => Promise<void>
|
||||
}
|
||||
13
src/interfaces/Command.ts
Normal file
13
src/interfaces/Command.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder} from "discord.js"
|
||||
import { ExtendedClient as Client } from "../utils/Client"
|
||||
|
||||
export default interface Command {
|
||||
name: string
|
||||
description: string
|
||||
type: "slash"
|
||||
dev?: boolean
|
||||
public: boolean
|
||||
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup" | "addIntegerOption">
|
||||
subcommands?: boolean
|
||||
execute: (interaction: ChatInputCommandInteraction, client: Client) => Promise<void>
|
||||
}
|
||||
19
src/interfaces/Config.ts
Normal file
19
src/interfaces/Config.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
interface ProdConfig {
|
||||
token: string
|
||||
mongoURI: string
|
||||
dev: string
|
||||
hypixelapikey: string
|
||||
redisURI: string
|
||||
}
|
||||
|
||||
interface DevConfig {
|
||||
devtoken: string
|
||||
clientid: string
|
||||
devid: string
|
||||
guildid: string
|
||||
}
|
||||
|
||||
export default interface Config {
|
||||
prod: ProdConfig
|
||||
dev: DevConfig
|
||||
}
|
||||
10
src/interfaces/ContextMenu.ts
Normal file
10
src/interfaces/ContextMenu.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ContextMenuCommandInteraction, ContextMenuCommandBuilder } from "discord.js"
|
||||
|
||||
export default interface ContextMenu {
|
||||
name: string
|
||||
description: string
|
||||
type: "contextmenu"
|
||||
dev?: boolean
|
||||
data: ContextMenuCommandBuilder
|
||||
execute: (interaction: ContextMenuCommandInteraction) => Promise<void>
|
||||
}
|
||||
9
src/interfaces/Event.ts
Normal file
9
src/interfaces/Event.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ClientEvents } from "discord.js"
|
||||
|
||||
export default interface Event {
|
||||
name: string,
|
||||
description: string,
|
||||
type: "event",
|
||||
event: keyof ClientEvents
|
||||
execute(...args: any[]): void
|
||||
}
|
||||
96
src/interfaces/Guild.ts
Normal file
96
src/interfaces/Guild.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
export interface Guild {
|
||||
data: {
|
||||
success: boolean
|
||||
guild: GuildData
|
||||
}
|
||||
}
|
||||
|
||||
export interface GuildData {
|
||||
_id: string
|
||||
name: string
|
||||
coins: number
|
||||
coinsEver: number
|
||||
created: number
|
||||
members: Member[]
|
||||
achievements: GuildAchievements
|
||||
exp: number
|
||||
legacyRanking: number
|
||||
name_lower: string
|
||||
tagColor: string
|
||||
description: string
|
||||
ranks: Rank[]
|
||||
preferredGames: string[]
|
||||
banner: Banner
|
||||
chatMute: number
|
||||
tag: string
|
||||
publiclyListed: boolean
|
||||
guildExpByGameType: GuildExpByGameType
|
||||
}
|
||||
|
||||
export interface Member {
|
||||
uuid: string
|
||||
rank: string
|
||||
joined: number
|
||||
questParticipation?: number
|
||||
expHistory: ExpHistory
|
||||
mutedTill?: number
|
||||
}
|
||||
|
||||
export interface ExpHistory {
|
||||
[key: string]: number
|
||||
}
|
||||
|
||||
export interface GuildAchievements {
|
||||
WINNERS: number
|
||||
EXPERIENCE_KINGS: number
|
||||
ONLINE_PLAYERS: number
|
||||
}
|
||||
|
||||
export interface Rank {
|
||||
name: string
|
||||
default: boolean
|
||||
tag: string
|
||||
created: number
|
||||
priority: number
|
||||
}
|
||||
|
||||
export interface Banner {
|
||||
Base: string
|
||||
Patterns: Pattern[]
|
||||
}
|
||||
|
||||
export interface Pattern {
|
||||
Pattern: string
|
||||
Color: any
|
||||
}
|
||||
|
||||
export interface GuildExpByGameType {
|
||||
PAINTBALL: number
|
||||
BUILD_BATTLE: number
|
||||
SKYWARS: number
|
||||
WOOL_GAMES: number
|
||||
MCGO: number
|
||||
GINGERBREAD: number
|
||||
REPLAY: number
|
||||
HOUSING: number
|
||||
VAMPIREZ: number
|
||||
PROTOTYPE: number
|
||||
ARCADE: number
|
||||
WALLS: number
|
||||
UHC: number
|
||||
WALLS3: number
|
||||
SKYBLOCK: number
|
||||
QUAKECRAFT: number
|
||||
SURVIVAL_GAMES: number
|
||||
SPEED_UHC: number
|
||||
ARENA: number
|
||||
DUELS: number
|
||||
MURDER_MYSTERY: number
|
||||
BEDWARS: number
|
||||
SUPER_SMASH: number
|
||||
PIT: number
|
||||
SMP: number
|
||||
BATTLEGROUND: number
|
||||
LEGACY: number
|
||||
TNTGAMES: number
|
||||
}
|
||||
8
src/interfaces/Modal.ts
Normal file
8
src/interfaces/Modal.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ModalSubmitInteraction } from "discord.js"
|
||||
|
||||
export default interface Modal {
|
||||
name: string
|
||||
description: string
|
||||
type: "modal"
|
||||
execute: (interaction: ModalSubmitInteraction) => Promise<void>
|
||||
}
|
||||
12045
src/interfaces/Player.ts
Normal file
12045
src/interfaces/Player.ts
Normal file
File diff suppressed because it is too large
Load Diff
24
src/interfaces/index.ts
Normal file
24
src/interfaces/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import Autocomplete from "./Autocomplete"
|
||||
import Button from "./Button"
|
||||
import Command from "./Command"
|
||||
import ContextMenu from "./ContextMenu"
|
||||
import Event from "./Event"
|
||||
import Modal from "./Modal"
|
||||
import Config from "./Config"
|
||||
|
||||
import { Guild, GuildData } from "./Guild"
|
||||
import { Player, PlayerData } from "./Player"
|
||||
|
||||
export {
|
||||
Config,
|
||||
Autocomplete,
|
||||
Button,
|
||||
Command,
|
||||
ContextMenu,
|
||||
Event,
|
||||
Modal,
|
||||
Guild,
|
||||
GuildData,
|
||||
Player,
|
||||
PlayerData
|
||||
}
|
||||
Reference in New Issue
Block a user