mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2025-03-13 22:09:47 -04:00
idk if this gonna fix it but prob no
This commit is contained in:
parent
16b9ce3704
commit
c601677e42
1 changed files with 31 additions and 31 deletions
62
index.js
62
index.js
|
@ -220,6 +220,37 @@ function main() {
|
|||
}
|
||||
}, 100);
|
||||
|
||||
bot.once('end', (reason, event) => {
|
||||
console.log(`Disconnected (${event} event): ${util.inspect(reason)}`);
|
||||
channel.send(`Disconnected (${event} event): \`${util.inspect(reason)}\``);
|
||||
|
||||
const timeout = config.reconnectTimeout;
|
||||
|
||||
// try {
|
||||
// if (reason.text) {
|
||||
// if (reason.text === 'Wait 5 seconds before connecting, thanks! :)') timeout = 1000 * 6;
|
||||
// if (reason.text === 'You are logging in too fast, try again later.') timeout = 1000 * 6;
|
||||
// }
|
||||
// } catch (e) {
|
||||
// console.log(e.message);
|
||||
// }
|
||||
|
||||
try {
|
||||
clearInterval(notonline);
|
||||
clearInterval(discordQueue);
|
||||
clearInterval(chatQueue);
|
||||
clearInterval(consoleQueueInterval);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
bot.end();
|
||||
botThings();
|
||||
main();
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
console.log(`Connecting to: ${bot.options.host}:${bot.options.port}...`);
|
||||
// fs.appendFileSync('./logs.txt', `\r\Connecting to: ${bot.options.host}:${bot.options.port}...\r\n`);
|
||||
channel.send(`Connecting to: \`${bot.options.host}:${bot.options.port}\`...`);
|
||||
|
@ -372,37 +403,6 @@ function main() {
|
|||
channel.send('uncaught ```\n' + util.inspect(error) + '\n```');
|
||||
bot.emit('end', 'uncaughtException', 'process: uncaughtException');
|
||||
});
|
||||
|
||||
bot.once('end', (reason, event) => {
|
||||
console.log(`Disconnected (${event} event): ${util.inspect(reason)}`);
|
||||
channel.send(`Disconnected (${event} event): \`${util.inspect(reason)}\``);
|
||||
|
||||
const timeout = config.reconnectTimeout;
|
||||
|
||||
// try {
|
||||
// if (reason.text) {
|
||||
// if (reason.text === 'Wait 5 seconds before connecting, thanks! :)') timeout = 1000 * 6;
|
||||
// if (reason.text === 'You are logging in too fast, try again later.') timeout = 1000 * 6;
|
||||
// }
|
||||
// } catch (e) {
|
||||
// console.log(e.message);
|
||||
// }
|
||||
|
||||
try {
|
||||
clearInterval(notonline);
|
||||
clearInterval(discordQueue);
|
||||
clearInterval(chatQueue);
|
||||
clearInterval(consoleQueueInterval);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
bot.end();
|
||||
botThings();
|
||||
main();
|
||||
}, timeout);
|
||||
});
|
||||
}
|
||||
|
||||
dcclient.on('ready', async () => {
|
||||
|
|
Loading…
Reference in a new issue