From 6968680899066a7540bd70669c17ab3b421e9aee Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 17 Jan 2023 17:39:43 -0700 Subject: [PATCH] misc.search: forgetting syntax moment --- src/modules/misc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/misc.js b/src/modules/misc.js index 68f4e75..34dce09 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -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`;