From 8a2a46ec8b58dc4b5cb120ca43abae6cc0f9efc3 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Wed, 23 Jun 2021 14:16:11 +0200 Subject: [PATCH] help command disable option --- src/Bot.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Bot.ts b/src/Bot.ts index f1ee31a..0929ca3 100644 --- a/src/Bot.ts +++ b/src/Bot.ts @@ -8,7 +8,8 @@ import { SystemMessageManager } from './SystemMessage.js'; //TYPE DEFINITIONS interface ConfigurationOptions { prefix: string, - token?: string + token?: string, + helpCommand: boolean } interface ConstructorOptions { name: string, @@ -39,7 +40,8 @@ class Bot { this.commands = new CommandsManager(); this.config = { prefix: options.prefix, - token: options.token + token: options.token, + helpCommand: options.helpCommand != undefined ? options.helpCommand : true } this.messages = { help: { @@ -69,8 +71,10 @@ class Bot { http.createServer().listen(port); } console.log('Starting modules...'); - const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name); - this.commands.add(helpMsg); + if(this.config.helpCommand) { + const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name); + this.commands.add(helpMsg); + } console.log('Connecting to Discord...'); if(await this.client.login(loginToken)) { console.log('BOT IS READY!\n');