fix list crash

This commit is contained in:
lolcat 2024-11-04 09:51:47 -05:00
parent 1840a95a0d
commit f1167272e3
1 changed files with 12 additions and 4 deletions

View File

@ -489,7 +489,7 @@ function mc_login(){
mc_logged_in = false; mc_logged_in = false;
console.log("Minecraft: Kicked from server"); console.log("Minecraft: Kicked from server");
setTimeout(mc_login, 5000); // reconnect after 5 seconds setTimeout(mc_login, 10000); // reconnect after 10 seconds
}); });
mc_bot.on("error", function(){ mc_bot.on("error", function(){
@ -583,12 +583,13 @@ deek.on("message", async function(msg, user){
if( if(
mc_bridge_enabled && mc_bridge_enabled &&
mc_logged_in mc_logged_in &&
msg.channel === 1
){ ){
// ascii filter // ascii filter
var mc_message = msg.text.replace( var mc_message = msg.text.replace(
/[^\n-!\"#$%&'()*+,.\/0123456789:;<=>?@[\\\]^_'abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«» ]/gi, /[^-\n!\"#$%&'()*+,.\/0123456789:;<=>?@[\\\]^_'abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«» ]/gi,
"?" "?"
); );
@ -1231,9 +1232,16 @@ deek.on("message", async function(msg, user){
break; break;
case "list": case "list":
case "l":
if(mc_bridge_enabled === false){ if(mc_bridge_enabled === false){
send(msg, "Minecraft bridge is disabled"); send(msg, "Deekcraft bridge is disabled");
break;
}
if(mc_logged_in === false){
send(msg, "Deekcraft is offline");
break; break;
} }