Archived
tweaks
This commit is contained in:
1 parent
73d758822e
commit
0addd3366f
2 files changed
+4
No files matched your search
@@ -59,6 +59,7 @@ class Bot {
|
|||||||
async start(port?: number, token?: string) : Promise<boolean> {
|
async start(port?: number, token?: string) : Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
console.log(`Bot name: ${this.name}`);
|
console.log(`Bot name: ${this.name}`);
|
||||||
|
console.log(`Prefix: ${this.config.prefix} \n`);
|
||||||
const loginToken: string = token || this.config.token || '';
|
const loginToken: string = token || this.config.token || '';
|
||||||
if(loginToken === '') {
|
if(loginToken === '') {
|
||||||
throw new ReferenceError('No token specified. Please pass your Discord application token as an argument to the "start" method or in the constructor');
|
throw new ReferenceError('No token specified. Please pass your Discord application token as an argument to the "start" method or in the constructor');
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ class CommandsManager {
|
|||||||
cmdArguments = cmdArguments.map((a) => {
|
cmdArguments = cmdArguments.map((a) => {
|
||||||
return a.replace(' ', '');
|
return a.replace(' ', '');
|
||||||
});
|
});
|
||||||
|
if((cmdArguments[0] == '' || cmdArguments[0] == ' ') && cmdArguments.length == 1) {
|
||||||
|
cmdArguments = [];
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
name: cmdName,
|
name: cmdName,
|
||||||
arguments: cmdArguments
|
arguments: cmdArguments
|
||||||
|
|||||||
Reference in new issue
Block a user