change reconnectect timeout and readd reason check

This commit is contained in:
ChomeNS 2022-10-25 13:36:13 +07:00
parent 99e28d5360
commit 40113fc0d8
2 changed files with 7 additions and 9 deletions

View file

@ -14,7 +14,7 @@ module.exports = {
'eval': {
'serverUrl': 'http://192.168.1.105:4445/',
},
'reconnectTimeout': 1000 * 6,
'reconnectTimeout': 1000 * 2,
'discord': {
'token': 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA',
'servers': {

View file

@ -217,14 +217,12 @@ function main() {
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 {
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) {}
try {
clearInterval(notonline);