// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const mahmud = async () => { const base = await axios.get("https://raw.githubusercontent.com/mahmudx7/HINATA/main/baseApiUrl.json"); return base.data.mahmud; }; module.exports = { config: { name: "sing2", version: "1.7", author: "MahMUD", countDown: 10, role: 0, category: "music", guide: "{p}sing mood" }, onStart: async function ({ api, event, args, message }) { if (args.length === 0) { return message.reply("โŒ | Please provide a sing name\n\nExample: sing moye moye"); } try { const query = encodeURIComponent(args.join(" ")); const apiUrl = `${await mahmud()}/api/sing?q=${query}`; const response = await axios.get(apiUrl, { responseType: "stream", headers: { "author": module.exports.config.author } }); console.log("Response:", response); if (response.data.error) { return message.reply(`${response.data.error}`); } message.reply({ body: `โœ… | ๐‡๐ž๐ซ๐ž'๐ฌ ๐ฒ๐จ๐ฎ๐ซ ๐ฌ๐จ๐ง๐ : ${args.join(" ")}`, attachment: response.data }); } catch (error) { console.error("Error:", error.message); if (error.response) { console.error("Response error data:", error.response.data); console.error("Response status:", error.response.status); return message.reply(`${error.response.data.error || error.message}`); } message.reply("error๐Ÿฅบ"); } } };