help command disable option

This commit is contained in:
mmacierzanka committed 2021-06-23 14:16:11 +02:00
1 parent 26513e7eb1
commit 8a2a46ec8b
1 file changed
+6 -2
+6 -2
View File
@@ -8,7 +8,8 @@ import { SystemMessageManager } from './SystemMessage.js';
//TYPE DEFINITIONS //TYPE DEFINITIONS
interface ConfigurationOptions { interface ConfigurationOptions {
prefix: string, prefix: string,
token?: string token?: string,
helpCommand: boolean
} }
interface ConstructorOptions { interface ConstructorOptions {
name: string, name: string,
@@ -39,7 +40,8 @@ class Bot {
this.commands = new CommandsManager(); this.commands = new CommandsManager();
this.config = { this.config = {
prefix: options.prefix, prefix: options.prefix,
token: options.token token: options.token,
helpCommand: options.helpCommand != undefined ? options.helpCommand : true
} }
this.messages = { this.messages = {
help: { help: {
@@ -69,8 +71,10 @@ class Bot {
http.createServer().listen(port); http.createServer().listen(port);
} }
console.log('Starting modules...'); console.log('Starting modules...');
if(this.config.helpCommand) {
const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name); const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name);
this.commands.add(helpMsg); this.commands.add(helpMsg);
}
console.log('Connecting to Discord...'); console.log('Connecting to Discord...');
if(await this.client.login(loginToken)) { if(await this.client.login(loginToken)) {
console.log('BOT IS READY!\n'); console.log('BOT IS READY!\n');