From c0a238d66a9075b63a0f2e148a900754cf993a83 Mon Sep 17 00:00:00 2001 From: Superkooka Date: Sun, 3 Jul 2022 21:43:59 +0200 Subject: [PATCH] :sparkles: use ShewenyClient instead of Container --- src/container.ts | 13 ------------- src/index.ts | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 21 deletions(-) delete mode 100644 src/container.ts diff --git a/src/container.ts b/src/container.ts deleted file mode 100644 index 7acd5d1..0000000 --- a/src/container.ts +++ /dev/null @@ -1,13 +0,0 @@ -export class Container { - static container: Container - - instance: Record = [] - - set(key: string, value: T) { - this.instance[key] = value - } - - get(key: string): T { - return this.instance[key] - } -} diff --git a/src/index.ts b/src/index.ts index 87a821e..99ee438 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ import { ShewenyClient } from "sheweny"; -import {Container} from "./container"; import {Config} from "./config"; import * as TOML from "toml"; import * as fs from "fs"; @@ -7,12 +6,16 @@ import * as fs from "fs"; const configurationFile = fs.readFileSync("./config.toml").toString() const configuration = TOML.parse(configurationFile) as Config -const container = new Container() -container.set("config", configuration) -Container.container = container +class Client extends ShewenyClient { + readonly config = configuration -const client = new ShewenyClient({ - intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_MESSAGES"], -}); + constructor() { + super({ + intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_MESSAGES"], + }); -client.login(configuration.token) + this.login(this.config.token) + } +} + +new Client();