This commit is contained in:
2024-11-03 16:59:48 -05:00
parent 243d49a6e4
commit 7f01482a6e

View File

@@ -8,6 +8,8 @@ const ddg = require("duckduckgo-images-api");
var mmm = require("mmmagic");
var Magic = mmm.Magic;
var ws_logged_in = false;
const mineflayer = require("mineflayer");
const mc_bridge_enabled = true;
@@ -200,6 +202,8 @@ async function serveddg(msg, results, page){
*/
async function send(channel, text, file = null, forcemime = null){
if(ws_logged_in === false){ return; }
if(typeof channel == "object"){
channel = channel.channel;
@@ -252,6 +256,7 @@ async function send(channel, text, file = null, forcemime = null){
/*
Handshake
*/
async function handshake(name, password){
/*
@@ -319,6 +324,7 @@ async function handshake(name, password){
ws.once("open", function(){
ws_logged_in = true;
deek.emit("login");
const keep_alive = setInterval(function(){
@@ -342,6 +348,7 @@ async function handshake(name, password){
ws.once("close", function(){
ws_logged_in = false;
deek.emit("close");
});
@@ -436,6 +443,7 @@ async function handshake(name, password){
ws.on("error", function(code, reason){
ws_logged_in = false;
deek.emit("error", "code=" + code + " reason=" + reason);
});
}