Skip to content

Instantly share code, notes, and snippets.

@ayashiiiyo
Created April 17, 2026 06:42
Show Gist options
  • Select an option

  • Save ayashiiiyo/60cd65ff33a8693775143c7fe7b768f4 to your computer and use it in GitHub Desktop.

Select an option

Save ayashiiiyo/60cd65ff33a8693775143c7fe7b768f4 to your computer and use it in GitHub Desktop.
import { load } from "cheerio"
let handler = async (m, { conn, args, command }) => {
try {
if (!args[0]) return m.reply(`*Example :* .${command} Al Fatihah`)
m.reply(global.wait)
const $ = load(await (await fetch("https://islamipedia.id/murottal/")).text())
const data = $(".surah-item").map((i, el) => ({
no: parseInt($(el).find("h5").text().split(".")[0]),
surah: ($(el).attr("data-title") || "").toLowerCase(),
arti: $(el).find("p").text().trim(),
audio: $(el).attr("data-audio") || ""
})).get()
const q = args.join(" ").toLowerCase()
const find = data.find(v => v.surah.replace(/[^a-z0-9]/g, "").includes(q.replace(/[^a-z0-9]/g, "")))
await conn.sendMessage(m.chat, { audio: { url: find.audio }, mimetype: "audio/mpeg" }, { quoted: m })
} catch (e) {
m.reply(e.message)
}
}
handler.help = ['murrotal <surah>']
handler.command = ['murrotal']
handler.tags = ['islami']
export default handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment