misc.search: did you mean deez nu-
This commit is contained in:
parent
5117f101e8
commit
690a8f8765
1 changed files with 6 additions and 4 deletions
|
@ -570,10 +570,12 @@ search.callback = async function (msg, line, args, {results = 2}) {
|
||||||
if (res.url != url) return res.url;
|
if (res.url != url) return res.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`);
|
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`).then(
|
||||||
const searchResults = await res
|
(res) => res.json()
|
||||||
.json()
|
);
|
||||||
.then((arr) => arr.splice(0, Number(results)));
|
const searchResults = res
|
||||||
|
.filter((result) => !("did_you_mean" in result))
|
||||||
|
.splice(0, Number(results));
|
||||||
|
|
||||||
let out = `__**Results for \`${safeString(query)}\`**__\n`;
|
let out = `__**Results for \`${safeString(query)}\`**__\n`;
|
||||||
for (const result of searchResults) {
|
for (const result of searchResults) {
|
||||||
|
|
Loading…
Reference in a new issue