This commit is contained in:
mmacierzanka committed 2021-06-20 17:26:31 +02:00
1 parent 73d758822e
commit 0addd3366f
2 files changed
+4

No files matched your search

+1
View File
@@ -59,6 +59,7 @@ class Bot {
async start(port?: number, token?: string) : Promise<boolean> {
try {
console.log(`Bot name: ${this.name}`);
console.log(`Prefix: ${this.config.prefix} \n`);
const loginToken: string = token || this.config.token || '';
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');
+3
View File
@@ -136,6 +136,9 @@ class CommandsManager {
cmdArguments = cmdArguments.map((a) => {
return a.replace(' ', '');
});
if((cmdArguments[0] == '' || cmdArguments[0] == ' ') && cmdArguments.length == 1) {
cmdArguments = [];
}
return {
name: cmdName,
arguments: cmdArguments