|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| const axios = require("axios"); |
| const { cmd } = require("../command"); |
|
|
| |
| cmd({ |
| pattern: "bible", |
| desc: "Fetch Bible verses by reference.", |
| category: "fun", |
| react: "📖", |
| filename: __filename |
| }, async (conn, mek, m, { args, reply }) => { |
| try { |
| |
| if (args.length === 0) { |
| return reply(`⚠️ *Please provide a Bible reference.*\n\n📝 *Example:*\n.bible John 1:1`); |
| } |
|
|
| |
| const reference = args.join(" "); |
|
|
| |
| const apiUrl = `https://bible-api.com/${encodeURIComponent(reference)}`; |
| const response = await axios.get(apiUrl); |
|
|
| |
| if (response.status === 200 && response.data.text) { |
| const { reference: ref, text, translation_name } = response.data; |
|
|
| |
| reply( |
| `📜 *Bible Verse Found!*\n\n` + |
| `📖 *Reference:* ${ref}\n` + |
| `📚 *Text:* ${text}\n\n` + |
| `🗂️ *Translation:* ${translation_name}\n\n © ENCRYPTO-27 BIBLE` |
| ); |
| } else { |
| reply("❌ *Verse not found.* Please check the reference and try again."); |
| } |
| } catch (error) { |
| console.error(error); |
| reply("⚠️ *An error occurred while fetching the Bible verse.* Please try again."); |
| } |
| }); |
|
|