fixed token

This commit is contained in:
mmacierzanka committed 2021-06-21 19:46:54 +02:00
1 parent 74ec7252ae
commit f6fdcde0c3
1 file changed
+8 -2
+8 -2
View File
@@ -60,8 +60,14 @@ class Bot {
try {
console.log(`Bot name: ${this.name}`);
console.log(`Prefix: ${this.config.prefix} \n`);
const loginToken: string = token || this.config.token || '';
if(loginToken === '') {
let loginToken;
if(this.config.token) {
loginToken = this.config.token;
}
else if(token) {
loginToken = token;
}
else {
throw new ReferenceError('No token specified. Please pass your Discord application token as an argument to the "start" method or in the constructor');
}
if(port) {