From 91bd5f960c7637a30b37e63a5f86fb3fc5872384 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Tue, 31 May 2022 17:09:01 +0200 Subject: [PATCH] [cmd](google) error when there are no results --- commands/message/search/google.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/message/search/google.js b/commands/message/search/google.js index dda89a9..65c24a9 100644 --- a/commands/message/search/google.js +++ b/commands/message/search/google.js @@ -39,6 +39,8 @@ module.exports = { let search = await google(context, args.query) search = search.response + if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]}) + let pages = [] for(const res of search.body.results){ pages.push(createSearchResultPage(context, res))