From ba7cce7aaa8a432472ee9169e358d8247062af9f Mon Sep 17 00:00:00 2001 From: Amar Verma <77249292+theamarverma@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:45:49 +0530 Subject: [PATCH 1/5] Delete src/commands/members/gs.ts --- src/commands/members/gs.ts | 47 -------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/commands/members/gs.ts diff --git a/src/commands/members/gs.ts b/src/commands/members/gs.ts deleted file mode 100644 index c9944b9..0000000 --- a/src/commands/members/gs.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { WAMessage } from "@whiskeysockets/baileys"; -import google from "googlethis"; -import { MsgInfoObj } from "../../interfaces/msgInfoObj"; -import { Bot } from "../../interfaces/Bot"; - -import getMessage from "../../functions/getMessage"; -import { prefix } from "../../utils/constants"; - -const handler = async (bot: Bot, msg: WAMessage, msgInfoObj: MsgInfoObj) => { - const { reply, command } = msgInfoObj; - - try { - const message = await getMessage(msg, command); - - if (!message) { - await reply(`❌ Query is not given! \nSend ${prefix}google query`); - return; - } - - const options = { - page: 0, - safe: false, // Safe Search - parse_ads: false, // If set to true sponsored results will be parsed - additional_params: { - // add additional parameters here, see https://moz.com/blog/the-ultimate-guide-to-the-google-search-parameters and https://www.seoquake.com/blog/google-search-param/ - hl: "en", - }, - }; - - const response = await google.search(message, options); - const { title, description, url } = response.results[0]; - const text = `*${title}*\n${description}\n\n${url}`; - await reply(text); - } catch (err) { - if (err instanceof Error) { - await reply(err.toString()); - } - } -}; - -const gs = () => { - const cmd = ["google", "search", "gs"]; - - return { cmd, handler }; -}; - -export default gs; From 7af14fe3eb0135b4fe33140e6777337adb8ab140 Mon Sep 17 00:00:00 2001 From: Amar Verma <77249292+theamarverma@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:49:43 +0530 Subject: [PATCH 2/5] Update addCommands.ts --- src/functions/addCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/addCommands.ts b/src/functions/addCommands.ts index 797cf54..0ea8efc 100644 --- a/src/functions/addCommands.ts +++ b/src/functions/addCommands.ts @@ -29,7 +29,7 @@ import checkvote from "../commands/members/checkvote"; import count from "../commands/members/count"; import fb from "../commands/members/fb"; import gender from "../commands/members/gender"; -import gs from "../commands/members/gs"; +import search from "../commands/public/search"; import horo from "../commands/members/horo"; import image from "../commands/members/image"; import imagesearch from "../commands/members/imagesearch"; From f7f17fe9f96f16bc12afe22308d4a5dd1be06f8d Mon Sep 17 00:00:00 2001 From: Amar Verma <77249292+theamarverma@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:50:48 +0530 Subject: [PATCH 3/5] Update addCommands.ts --- src/functions/addCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/addCommands.ts b/src/functions/addCommands.ts index 0ea8efc..970f507 100644 --- a/src/functions/addCommands.ts +++ b/src/functions/addCommands.ts @@ -109,6 +109,7 @@ const addCommands = async () => { source, steal, votecommand, + search ]; publicCommands.forEach((command) => { @@ -160,7 +161,6 @@ const addCommands = async () => { count, fb, gender, - gs, horo, image, imagesearch, From 9960b2bb09e6ddc4e118614594b20f098d3e45c0 Mon Sep 17 00:00:00 2001 From: Amar Verma <77249292+theamarverma@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:09:19 +0530 Subject: [PATCH 4/5] Create search.ts --- src/commands/public/search.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/commands/public/search.ts diff --git a/src/commands/public/search.ts b/src/commands/public/search.ts new file mode 100644 index 0000000..d4f3df2 --- /dev/null +++ b/src/commands/public/search.ts @@ -0,0 +1,18 @@ +import { WAMessage } from "@whiskeysockets/baileys"; +import { MsgInfoObj } from "../../interfaces/msgInfoObj"; +import { Bot } from "../../interfaces/Bot"; + +const handler = async (bot: Bot, msg: WAMessage, msgInfoObj: MsgInfoObj) => { + const { reply } = msgInfoObj; + const text = `https://giybf.com/`; + + await reply(text); +}; + +const search = () => { + const cmd = ["search"]; + + return { cmd, handler }; +}; + +export default search; From a484914928e865775e125913d1d991f9234903f7 Mon Sep 17 00:00:00 2001 From: Amar Verma <77249292+theamarverma@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:15:07 +0530 Subject: [PATCH 5/5] Update addCommands.ts --- src/functions/addCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/addCommands.ts b/src/functions/addCommands.ts index 970f507..3b95fe7 100644 --- a/src/functions/addCommands.ts +++ b/src/functions/addCommands.ts @@ -29,7 +29,6 @@ import checkvote from "../commands/members/checkvote"; import count from "../commands/members/count"; import fb from "../commands/members/fb"; import gender from "../commands/members/gender"; -import search from "../commands/public/search"; import horo from "../commands/members/horo"; import image from "../commands/members/image"; import imagesearch from "../commands/members/imagesearch"; @@ -83,6 +82,7 @@ import helpa from "../commands/public/helpa"; import helpo from "../commands/public/helpo"; import link from "../commands/public/link"; import source from "../commands/public/source"; +import search from "../commands/public/search"; import steal from "../commands/public/steal"; import votecommand from "../commands/public/votecommand";