misc.search: forgetting syntax moment

This commit is contained in:
Cynthia Foxwell 2023-01-17 17:39:43 -07:00
parent 906baf31c2
commit 6968680899

View file

@ -552,11 +552,12 @@ search.helpText = "Search, powered by LibreX";
search.addAlias("g");
search.addAlias("google");
search.addAlias("ddg");
search.callback = async function (msg, line, {results = 2}, [query]) {
search.callback = async function (msg, line, args, {results = 2}) {
const query = args.join(" ");
if (!librex) return "LibreX instance not defined.";
if (!query || query == "") return "Search query required.";
const encodedQuery = encodeURIComponent(line);
const encodedQuery = encodeURIComponent(query);
if (line.startsWith("!")) {
const url = `https://api.duckduckgo.com/?q=${encodedQuery}&format=json`;