From 8d93693a38f55c442372cac8f76211f27a752d0b Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 28 Oct 2022 15:25:58 +1100 Subject: Move src-slowcord to own repo https://github.com/MaddyUnderStars/slowcord-services --- src-slowcord/bot/src/Bot.ts | 50 --------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 src-slowcord/bot/src/Bot.ts (limited to 'src-slowcord/bot/src/Bot.ts') diff --git a/src-slowcord/bot/src/Bot.ts b/src-slowcord/bot/src/Bot.ts deleted file mode 100644 index cf3ff09f..00000000 --- a/src-slowcord/bot/src/Bot.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Message } from "discord.js"; -import { Client } from "fosscord-gopnik/build/lib"; // huh? oh well. some bugs in my lib Ig - -import { Command, getCommands } from "./commands/index.js"; - -export default class Bot { - client: Client; - commands: { [key: string]: Command } = {}; - - constructor(client: Client) { - this.client = client; - } - - onReady = async () => { - this.commands = await getCommands(); - - console.log(`Logged in as ${this.client.user!.tag}`); - - this.client.user!.setPresence({ - activities: [ - { - name: "EVERYTHING", - type: "WATCHING", - }, - ], - }); - }; - - onMessageCreate = async (msg: Message) => { - const prefix = process.env.PREFIX as string; - if (msg.author.bot) return; - if (!msg.content || msg.content.indexOf(prefix) === -1) return; - - const content = msg.content.slice(prefix.length).split(" "); - const cmd = content.shift(); - if (!cmd) return; - const args = content; - - const command = this.commands[cmd]; - if (!command) return; - - await command.exec({ - user: msg.author, - member: msg.member, - guild: msg.guild, - message: msg, - args: args, - }); - }; -} -- cgit 1.5.1