// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "google", aliases: ["search", "lens"], version: "1.1", author: "ryuko", countDown: 5, role: 0, shortDescription: { en: "Search on Google", bn: "গুগলে সার্চ করুন" }, longDescription: { en: "Get a Google search link for text, or a Google Lens link for an image", bn: "টেক্সটের জন্য গুগল সার্চ লিংক, আর ছবির জন্য গুগল লেন্স লিংক পান" }, category: "utility", guide: { en: "{pn} \nor reply to an image with {pn}", bn: "{pn} <টেক্সট>\nঅথবা কোনো ছবিতে রিপ্লাই দিয়ে {pn}" } }, langs: { en: { noInput: "⚠️ Please enter some text or reply to an image." }, bn: { noInput: "⚠️ কিছু লিখুন অথবা কোনো ছবিতে রিপ্লাই দিন।" } }, onStart: async function ({ event, args, message, getLang }) { let text = ""; if (event.type == "message_reply") { const att = event.messageReply.attachments; text = (att && att[0]) ? att[0].url : event.messageReply.body; } else { text = args.join(" "); } if (!text) return message.reply(getLang("noInput")); const isImage = /^https?:\/\/.*\.(png|jpe?g|gif)/i.test(text); const link = isImage ? `https://lens.google.com/uploadbyurl?url=${encodeURIComponent(text)}` : `https://www.google.com/search?q=${encodeURIComponent(text)}`; return message.reply(link); } };