xeno bugfix

This commit is contained in:
lolcat 2025-01-04 23:13:13 -05:00
parent 1431cd3d1b
commit 6f9e2e5b72
1 changed files with 27 additions and 4 deletions

View File

@ -16,7 +16,7 @@ const mineflayer = require("mineflayer");
const mc_bridge_enabled = false; const mc_bridge_enabled = false;
const irc_bridge_enabled = true; const irc_bridge_enabled = true;
const instance = "https://4get.lumaeris.com"; const instance = "https://4get.lumaeris.com";
var scraper = "ddg"; var scraper = "google_cse";
const mc_options = { const mc_options = {
"host": "deek.chat", "host": "deek.chat",
@ -647,6 +647,7 @@ init_irc();
async function fetch_xeno(recording, index, msg){ async function fetch_xeno(recording, index, msg){
index--; index--;
console.log(recording[index]);
var filereq = await fetch( var filereq = await fetch(
recording[index].file, recording[index].file,
@ -1448,9 +1449,31 @@ deek.on("message", async function(msg, user){
global_page = 1; global_page = 1;
is_pp_xeno = true; is_pp_xeno = true;
results_cache = res_get.recordings;
await fetch_xeno(res_get.recordings, 1, msg); // filter out restricted results
results_cache = [];
for(var k=0; k<res_get.recordings.length; k++){
if(
typeof res_get.recordings[k].file == "string" &&
res_get.recordings[k].file != ""
){
results_cache.push(res_get.recordings[k]);
}
}
if(results_cache.length === 0){
send(
msg,
"This species has been raped to death by filthy h*mans and is not available for listening"
);
break;
}
await fetch_xeno(results_cache, 1, msg);
break; break;
case "fortune": case "fortune":
@ -1667,7 +1690,7 @@ deek.on("message", async function(msg, user){
) )
.resize( .resize(
{ {
width: 350, width: 450,
fit: "inside" fit: "inside"
} }
) )