From ffc5592055240e153673c1fa7a3f74ab367db49b Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 17 Oct 2020 12:15:46 +1100 Subject: [PATCH] bye typescript --- bot/index.ts | 86 -------------------------------------------- bot/util/database.ts | 0 2 files changed, 86 deletions(-) delete mode 100644 bot/index.ts delete mode 100644 bot/util/database.ts diff --git a/bot/index.ts b/bot/index.ts deleted file mode 100644 index 134aace..0000000 --- a/bot/index.ts +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license. - -import { Client, Collection } from 'discord.js'; -import sentry from '@sentry/node'; -import logger from './util/logger'; -import functions from './util/functions'; -import database from './util/database'; -import { CommandHandler, EventHandler } from './util/handlers'; - - -const config: any = require('../config.json'); -const pkg: any = require('../package.json'); - -class WoomyClient extends Client { - - public config: any; - public path: string; - public dev: boolean; - public version: string; - public logger: any; - public functions: any; - public db: any; - public commands: any; - public aliases: any; - public cooldowns: any; - public commandHandler: any; - public eventHandler: any; - - public constructor () { - super(); - - // Important information our bot needs to access - this.config = config; - this.path = __dirname; - this.version = pkg.version; - - // dev mode, disables some features if enabled - this.dev = false; - if (this.config.devmode === true) { - this.dev = true; - sentry.init({ dsn: this.config.kets.sentry }); - }; - - // Essential modules - this.logger = logger; - this.functions = new functions(this); - this.db = new database(this); - - // collections, to store commands, their aliases and their cooldown timers in - this.commands = new Collection(); - this.aliases = new Collection(); - this.cooldowns = new Collection; - - // Handlers, to load commands and events - this.commandHandler = new CommandHandler(this); - this.eventHandler = new EventHandler(this); - }; -}; - -async function init(): Promise { - const client = new WoomyClient(); - - client.logger.info(`Initializing Woomy v${client.version}`); - - await client.commandHandler.loadAll(); - await client.eventHandler.loadAll(); - - if (client.dev === true) { - client.logger.warn('Development mode is enabled. Some features (such as Sentry) have been disabled.'); - client.login(client.config.devtoken); - } else { - client.login(client.config.token); - }; -}; - -init(); - -process.on('uncaughtException', (err) => { - const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, 'g'), './'); - console.error('Uncaught Exception: ', errorMsg); - process.exit(1); -}); - -process.on('unhandledRejection', err => { - console.error('Uncaught Promise Error: ', err); -}); \ No newline at end of file diff --git a/bot/util/database.ts b/bot/util/database.ts deleted file mode 100644 index e69de29..0000000