Archived
help command disable option
This commit is contained in:
1 parent
26513e7eb1
commit
8a2a46ec8b
1 file changed
+8
-4
+8
-4
@@ -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...');
|
||||||
const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name);
|
if(this.config.helpCommand) {
|
||||||
this.commands.add(helpMsg);
|
const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.config.prefix, this.name);
|
||||||
|
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');
|
||||||
|
|||||||
Reference in new issue
Block a user