From c697fa31a14e30cbe93161177c898ff547154db8 Mon Sep 17 00:00:00 2001 From: lolcat Date: Mon, 2 Oct 2023 22:51:09 -0500 Subject: [PATCH] i need to stop deeking around --- client.js | 376 +++++++++++++++++------------------------------------- 1 file changed, 119 insertions(+), 257 deletions(-) diff --git a/client.js b/client.js index f206e98..81e8e88 100755 --- a/client.js +++ b/client.js @@ -5,7 +5,6 @@ const formdata = require("form-data"); const he = require("he"); const cheerio = require("cheerio"); const ddg = require("duckduckgo-images-api"); -const yt = require("ytsr"); var mmm = require("mmmagic"); var Magic = mmm.Magic; @@ -31,7 +30,7 @@ var img_headers = { }; var headers = { - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0", + "User-Agent": "renabot", Origin: "https://deek.chat" }; @@ -123,22 +122,12 @@ async function send(channel, text, file = null){ channel = channel.channel; } - for(var i=0; i" + res_get.status); + return; + } + + var text = []; + + for(var i=0; iDuration: " + (new Date(res_get.video[i].duration * 1000).toISOString().slice(11, 19)) + + " • views: " + (new Intl.NumberFormat().format(res_get.video[i].views)) + + " • author: " + res_get.video[i].author.name + + "\n" + res_get.video[i].title + + "\n▶ " + res_get.video[i].url + ); } - send(msg, "Search results for \"" + ytsearch.correctedQuery + "\"\n\n" + text.trim()); + send(msg, "Search results for \"" + value + "\"\n\n" + text.join("\n\n")); break; case "help": @@ -944,7 +806,7 @@ deek.on("message", async function(msg, user){ ".boobs => Boobs?\n" + ".page/.p => get page offset for image search\n" + ".pp => get next page\n" + - ".yt/.youtube => search the jewish propaganda catalog\n" + + ".yt/.youtube => search the jewish propaganda catalog (now powered by 4get)\n" + ".roll/.r => Because deekchat was too slow\n" + ".mumble/.m <[optional]ip:port> => check if lolcat died\n" + ".prop => check if the sun has exploded or smth\n" + @@ -956,7 +818,7 @@ deek.on("message", async function(msg, user){ deek.on("close", function(channel){ - console.log("It's over. Disconnected from channel " + channel.name + ". Attempting reconnection in 10 seconds"); + console.log("It's over. Disconnected from websocket. Attempting reconnection in 10 seconds"); setTimeout(function(){ @@ -975,4 +837,4 @@ deek.on("error", function(message){ }); // connect to serber -handshake(name, password); +handshake(name, password); \ No newline at end of file