diff --git a/index.ts b/index.ts index f23bd11..7dda551 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,17 @@ //@ts-ignore import config from "./config"; -import client from "./src/handler/client/Client" -let Bot = new client(config) +import { Discord } from "@thaldrin/eu" +import { Intents } from "discord.js"; +import { join } from 'path' + + +let Bot = new Discord.Client({ + // @ts-ignore + token: config.discord?.token, + commands: join(__dirname, "src", "discord", 'commands'), + events: join(__dirname, "src", "discord", 'events'), + options: { + commandCategories: true, + intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] + } +}) diff --git a/shard.ts b/shard.ts index 3b12e87..a28578e 100644 --- a/shard.ts +++ b/shard.ts @@ -1,8 +1,9 @@ -import { ShardingManager } from "discord.js"; +import { Discord } from "@thaldrin/eu"; import config from "./config"; import figlet from "figlet" -let Sharder = new ShardingManager('./build/index.js', { - token: config.token, + +let Sharder = new Discord.ShardingManager('./build/index.js', { + token: config.discord?.token, totalShards: "auto" }) import chalk from "chalk" diff --git a/src/utils/types.ts b/src/utils/types.ts index 08eadac..8c652f6 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -1,6 +1,6 @@ import { SupabaseClient } from "@supabase/supabase-js"; import { Client, Guild, GuildMember, Message, NewsChannel, TextChannel, User } from "discord.js"; -import Thaldrin from "../handler/client/Client"; +import { EuClient } from "@thaldrin/eu/build/misc/types"; export type Features = | "shortlinks" @@ -56,14 +56,14 @@ export type Command = { export type Context = { - client: Thaldrin; + client: EuClient; args: string[] guild: Guild | null; message: Message; channel: TextChannel | NewsChannel; author: User; member: GuildMember | null; - supabase: SupabaseClient; + modulus: any; settings: Server; config: Config; isDeveloper: string[] @@ -88,7 +88,15 @@ export interface Config { /** * Discord API Token */ - token: string; + discord?: { + token?: string + }; + /** + * Revolt API Token + */ + revolt?: { + token?: string + }; /** * Config Strings for Supabase * Thaldrin's Database @@ -183,9 +191,6 @@ export interface Variables { } website: string invite: any; - prometheus: { - port: number - } } export interface Pkg { diff --git a/variables.ts b/variables.ts index fff45ac..fdc72c9 100644 --- a/variables.ts +++ b/variables.ts @@ -53,7 +53,4 @@ export default { color: "#ff995d", website: "thaldr.in", invite: "https://t8.pm/legacy-invite", - prometheus: { - port: 3621 - } } \ No newline at end of file