Spaces:
Paused
Paused
𝗗𝗔𝗥𝗥𝗘𝗟𝗟 𝗠𝗨𝗖𝗛𝗘𝗥𝗜 ⚡
commited on
Create tool-bible.js
Browse files- plugins/tool-bible.js +61 -0
plugins/tool-bible.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺
|
| 2 |
+
⭐PROJECT NAME:
|
| 3 |
+
SUBZERO MD ᐯ2
|
| 4 |
+
|
| 5 |
+
⭐DEVELOPER
|
| 6 |
+
MR FRANK
|
| 7 |
+
|
| 8 |
+
⭐ MY TEAM
|
| 9 |
+
XERO CODERS
|
| 10 |
+
|
| 11 |
+
⭐ OUR WEBSITE
|
| 12 |
+
https://github.com/mrfrank-ofc/SUBZERO-V2
|
| 13 |
+
|
| 14 |
+
© Recoding This Script In Unacceptable⚠
|
| 15 |
+
|
| 16 |
+
╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺*/
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
const axios = require("axios");
|
| 20 |
+
const { cmd } = require("../command");
|
| 21 |
+
|
| 22 |
+
// Command: bible
|
| 23 |
+
cmd({
|
| 24 |
+
pattern: "bible",
|
| 25 |
+
desc: "Fetch Bible verses by reference.",
|
| 26 |
+
category: "fun",
|
| 27 |
+
react: "📖",
|
| 28 |
+
filename: __filename
|
| 29 |
+
}, async (conn, mek, m, { args, reply }) => {
|
| 30 |
+
try {
|
| 31 |
+
// Vérifiez si une référence est fournie
|
| 32 |
+
if (args.length === 0) {
|
| 33 |
+
return reply(`⚠️ *Please provide a Bible reference.*\n\n📝 *Example:*\n.bible John 1:1`);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// Joindre les arguments pour former la référence
|
| 37 |
+
const reference = args.join(" ");
|
| 38 |
+
|
| 39 |
+
// Appeler l'API avec la référence
|
| 40 |
+
const apiUrl = `https://bible-api.com/${encodeURIComponent(reference)}`;
|
| 41 |
+
const response = await axios.get(apiUrl);
|
| 42 |
+
|
| 43 |
+
// Vérifiez si la réponse contient des données
|
| 44 |
+
if (response.status === 200 && response.data.text) {
|
| 45 |
+
const { reference: ref, text, translation_name } = response.data;
|
| 46 |
+
|
| 47 |
+
// Envoyez la réponse formatée avec des emojis
|
| 48 |
+
reply(
|
| 49 |
+
`📜 *Bible Verse Found!*\n\n` +
|
| 50 |
+
`📖 *Reference:* ${ref}\n` +
|
| 51 |
+
`📚 *Text:* ${text}\n\n` +
|
| 52 |
+
`🗂️ *Translation:* ${translation_name}\n\n © SUBZERO BIBLE`
|
| 53 |
+
);
|
| 54 |
+
} else {
|
| 55 |
+
reply("❌ *Verse not found.* Please check the reference and try again.");
|
| 56 |
+
}
|
| 57 |
+
} catch (error) {
|
| 58 |
+
console.error(error);
|
| 59 |
+
reply("⚠️ *An error occurred while fetching the Bible verse.* Please try again.");
|
| 60 |
+
}
|
| 61 |
+
});
|