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;
|
||||
}
|
||||
|
||||
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`);
|
||||
const searchResults = await res
|
||||
.json()
|
||||
.then((arr) => arr.splice(0, Number(results)));
|
||||
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`).then(
|
||||
(res) => res.json()
|
||||
);
|
||||
const searchResults = res
|
||||
.filter((result) => !("did_you_mean" in result))
|
||||
.splice(0, Number(results));
|
||||
|
||||
let out = `__**Results for \`${safeString(query)}\`**__\n`;
|
||||
for (const result of searchResults) {
|
||||
|
|
Loading…
Reference in a new issue