-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9513a64
commit 7c75a10
Showing
8 changed files
with
1,224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import fetch from 'node-fetch'; | ||
import { translate } from '@vitalets/google-translate-api'; | ||
|
||
let Handler = async (m, { conn }) => { | ||
try { | ||
// Extract the surah number or name from the command text. | ||
let surahInput = m.text.split(' ')[1]; | ||
|
||
if (!surahInput) { | ||
throw new Error(`Please specify the surah number or name`); | ||
} | ||
|
||
let surahListRes = await fetch('https://quran-endpoint.vercel.app/quran'); | ||
let surahList = await surahListRes.json(); | ||
|
||
let surahData = surahList.data.find(surah => | ||
surah.number === Number(surahInput) || | ||
surah.asma.ar.short.toLowerCase() === surahInput.toLowerCase() || | ||
surah.asma.en.short.toLowerCase() === surahInput.toLowerCase() | ||
); | ||
|
||
if (!surahData) { | ||
throw new Error(`Couldn't find surah with number or name "${surahInput}"`); | ||
} | ||
|
||
let res = await fetch(`https://quran-endpoint.vercel.app/quran/${surahData.number}`); | ||
|
||
if (!res.ok) { | ||
let error = await res.json(); | ||
throw new Error(`API request failed with status ${res.status} and message ${error.message}`); | ||
} | ||
|
||
let json = await res.json(); | ||
|
||
// Translate tafsir from Bahasa Indonesia to Urdu | ||
let translatedTafsirUrdu = await translate(json.data.tafsir.id, { to: 'ur', autoCorrect: true }); | ||
|
||
// Translate tafsir from Bahasa Indonesia to English | ||
let translatedTafsirEnglish = await translate(json.data.tafsir.id, { to: 'en', autoCorrect: true }); | ||
|
||
let quranSurah = ` | ||
🕌 *Quran: The Holy Book*\n | ||
📜 *Surah ${json.data.number}: ${json.data.asma.ar.long} (${json.data.asma.en.long})*\n | ||
Type: ${json.data.type.en}\n | ||
Number of verses: ${json.data.ayahCount}\n | ||
🔮 *Explanation (Urdu):*\n | ||
${translatedTafsirUrdu.text}\n | ||
🔮 *Explanation (English):*\n | ||
${translatedTafsirEnglish.text}`; | ||
|
||
m.reply(quranSurah); | ||
|
||
if (json.data.recitation.full) { | ||
conn.sendFile(m.chat, json.data.recitation.full, 'recitation.mp3', null, m, true, { type: 'audioMessage', ptt: true }); | ||
} | ||
} catch (error) { | ||
console.error(error); | ||
m.reply(`Error: ${error.message}`); | ||
} | ||
}; | ||
|
||
Handler.help = ['quran [surah_number|surah_name]']; | ||
Handler.tags = ['quran', 'surah']; | ||
Handler.command = ['quran', 'surah'] | ||
|
||
export default Handler; | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import fetch from 'node-fetch'; | ||
|
||
const handler = async (m, {conn, text, usedPrefix, command}) => { | ||
if (!text) { | ||
throw `*Example:* ${usedPrefix + command} Hello Bing`; | ||
} | ||
|
||
try { | ||
m.react('👁'); | ||
|
||
const API_URL = `https://aemt.me/bingai?text=${encodeURIComponent(text)}`; | ||
const response = await fetch(API_URL); | ||
const data = await response.json(); | ||
|
||
if (data.status && data.result) { | ||
const respuestaAPI = data.result + "_©️Bing: ʙʏ ɴᴀꜱʀᴜʟʟᴀʜ ᴍᴀᴄʜɪ🦹♂️_"; | ||
conn.reply(m.chat, respuestaAPI, m); | ||
} else { | ||
throw '*Server is busy now. Try again Later.*'; | ||
} | ||
} catch (error) { | ||
throw `*Error*`; | ||
} | ||
}; | ||
|
||
handler.command = /^bing$/i; | ||
|
||
export default handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import fetch from 'node-fetch' | ||
import uploader from '../lib/uploadImage.js' | ||
|
||
var handler = async (m, { conn, text, command, usedPrefix }) => { | ||
|
||
let q = m.quoted ? m.quoted : m | ||
let mime = (q.msg || q).mimetype || q.mediaType || '' | ||
if (!mime){ | ||
if (!text) throw `*🎟 ️Ask Question* \n\n *_Example:_* *.bard Hi* \n\n*_Example 2:_* *.ans who are you? * \n\n *I'm ready to help and reply your queries*` | ||
await m.react('🪄') | ||
let json = await (await fetch(`https://aemt.me/bard?text=${text}`)).json() | ||
conn.sendMessage(m.chat, { text: json.result + "\n\n*_©️Bard: ʙʏ ɴᴀꜱʀᴜʟʟᴀʜ ᴍᴀᴄʜɪ🦹♂️_*" }, { quoted: m }) | ||
|
||
} else | ||
if (/image/g.test(mime) && !/webp/g.test(mime)) { | ||
let buffer = await q.download() | ||
await m.react('🪄') | ||
let media = await (uploader)(buffer) | ||
if (!text) throw `*🎟️ Upload image with Question*\n\n 🪄 *_Example:_* *What is this?* \n\n *I'm ready to help and reply your queries.*` | ||
|
||
let json = await (await fetch(`https://aemt.me/bardimg?url=${media}&text=${text}`)).json() | ||
|
||
conn.sendMessage(m.chat, { text: json.result + "\n\n*_©️Bard: ʙʏ ɴᴀꜱʀᴜʟʟᴀʜ ᴍᴀᴄʜɪ🦹♂️_*" }, { quoted: m }) | ||
|
||
} else return conn.reply(m.chat, `*🎟️Upload image with Question\n I'm ready to help and reply your queries.*`, m ) | ||
|
||
} | ||
|
||
handler.command = /^(bard|ask|ans)$/i | ||
|
||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import fetch from 'node-fetch' | ||
import uploader from '../lib/uploadImage.js' | ||
|
||
var handler = async (m, { conn, text, command, usedPrefix }) => { | ||
|
||
let q = m.quoted ? m.quoted : m | ||
let mime = (q.msg || q).mimetype || q.mediaType || '' | ||
if (!mime){ | ||
if (!text) throw `*🎟 ️Ask Question* \n\n *_Example:_* *.bard Hi* \n\n*_Example 2:_* *.ans who are you? * \n\n *I'm ready to help and reply your queries*` | ||
await m.react('🪄') | ||
let json = await (await fetch(`https://aemt.me/bard?text=${text}`)).json() | ||
conn.sendMessage(m.chat, { text: json.result + "\n\n*_©️Bard: ʙʏ ɴᴀꜱʀᴜʟʟᴀʜ ᴍᴀᴄʜɪ🦹♂️_*" }, { quoted: m }) | ||
|
||
} else | ||
if (/image/g.test(mime) && !/webp/g.test(mime)) { | ||
let buffer = await q.download() | ||
await m.react('🪄') | ||
let media = await (uploader)(buffer) | ||
if (!text) throw `*🎟️ Upload image with Question*\n\n 🪄 *_Example:_* *What is this?* \n\n *I'm ready to help and reply your queries.*` | ||
|
||
let json = await (await fetch(`https://aemt.me/bardimg?url=${media}&text=${text}`)).json() | ||
|
||
conn.sendMessage(m.chat, { text: json.result + "\n\n*_©️Bard: ʙʏ ɴᴀꜱʀᴜʟʟᴀʜ ᴍᴀᴄʜɪ🦹♂️_*" }, { quoted: m }) | ||
|
||
} else return conn.reply(m.chat, `*🎟️Upload image with Question\n I'm ready to help and reply your queries.*`, m ) | ||
|
||
} | ||
|
||
handler.command = /^(bard|ask|ans)$/i | ||
|
||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import axios from "axios" | ||
let handler = async (m, { args }) => { | ||
if (!args[0]) throw "No matchs found. Or Type correct match id" | ||
const response = axios.get(`https://cric-theta.vercel.app/score?url=https://m.cricbuzz.com/cricket-commentary/${args}×tamp=`+new Date()); | ||
const res = await response | ||
|
||
let msg = '' | ||
if (res.data.title) msg += res.data.title + `\n` | ||
if (res.data.update) msg += `*`+res.data.update + `*\n\n` | ||
if (res.data.current) msg += '*'+res.data.current + `*\n` | ||
if (res.data.batsman) msg += `Batsman 🏏: *${res.data.batsman} - ${res.data.batsmanrun} ${res.data.ballsfaced}\n` | ||
if (res.data.sr) msg +=`Strike rate: ${res.data.sr}\n` | ||
if (res.data.batsman) msg +=`Batsman 2 🏏: *${res.data.batsmantwo}* - ${res.data.batsmantworun} ${res.data.batsmantwoballsfaced}\n` | ||
if (res.data.batsman) msg += `Strike rate: ${res.data.batsmantwosr}\n\n` | ||
if (res.data.batsman) msg += `Bowler ⚾: *${res.data.bowler}*\n` | ||
if (res.data.batsman) msg +=`Over: ${res.data.bowlerover}\n` | ||
if (res.data.batsman) msg += `Runs: ${res.data.bowlerruns}\n` | ||
if (res.data.batsman) msg +=`Wickets: ${res.data.bowlerwickets}\n` | ||
if (res.data.batsman) msg+=`Bowler 2: ${res.data.bowlertwo}\n\n` | ||
if (res.data.batsman) { | ||
msg += `${res.data.recentballs}\n\n` | ||
msg += `Last wicket ❌ ${res.data.lastwicket}\n` | ||
msg += `Run rate %: *${res.data.runrate}*\n` | ||
} | ||
m.reply('*Live score updating... 🏏🏏*') | ||
m.reply(msg) | ||
} | ||
handler.help = ['score *<matchID>*'] | ||
handler.tags = ['herramientas'] | ||
handler.command = /^(cricket|score)$/i | ||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import axios from "axios" | ||
let handler = async (m, { args }) => { | ||
const response = axios.get(`https://cric-theta.vercel.app/geo?url=https://urdu.geo.tv/`); | ||
const res = await response | ||
|
||
let msg = '' | ||
if (res.data.newsb) msg += "\n📺*جیو نیوز*\n\n" + res.data.newsb | ||
if (res.data.newsc) msg += res.data.newsc | ||
if (res.data.newsd) msg += res.data.newsd | ||
if (res.data.newse) msg += res.data.newse | ||
if (res.data.newsf) msg += res.data.newsf | ||
if (res.data.newg) msg += res.data.newsg | ||
if (res.data.newsh) msg += res.data.newsh | ||
if (res.data.newsi) msg += res.data.newsi | ||
if (res.data.newsj) msg += res.data.newsj | ||
if (res.data.newsk) msg += res.data.newsk | ||
|
||
m.reply(msg) | ||
} | ||
handler.help = ['geo'] | ||
handler.tags = ['herramientas'] | ||
handler.command = /^(geo|geonews)$/i | ||
export default handler |
Oops, something went wrong.