Spaces:
Paused
Paused
| const config = require('../config'); | |
| const { cmd, commands } = require('../command'); | |
| const { runtime } = require('../lib/functions'); | |
| const axios = require('axios'); | |
| function isEnabled(value) { | |
| // Function to check if a value represents a "true" boolean state | |
| return value && value.toString().toLowerCase() === "true"; | |
| } | |
| cmd({ | |
| pattern: "env", | |
| alias: ["settings", "allvar"], | |
| desc: "Settings of bot", | |
| category: "menu", | |
| react: "β", | |
| filename: __filename | |
| }, | |
| async (conn, mek, m, { from, quoted, reply }) => { | |
| try { | |
| // Define the settings message with the correct boolean checks | |
| let envSettings = `ββββγ *SUBZERO-MD* γβββββ· | |
| ββΈββββββββββββ | |
| ββΈβΰΉ *SUBZERO MD SETTINGS βοΈ* | |
| ββΈββββββββββββΒ·Β·Β·ΰΉ | |
| β°ββββββββββββββββββ· | |
| βββγ *Enabled Disabled* γββββ· | |
| βΰΉ *Auto Read Status:* ${isEnabled(config.AUTO_STATUS_SEEN) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Reply Status:* ${isEnabled(config.AUTO_STATUS_REPLY) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Reply:* ${isEnabled(config.AUTO_REPLY) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Sticker:* ${isEnabled(config.AUTO_STICKER) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Voice:* ${isEnabled(config.AUTO_VOICE) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Custom Reacts:* ${isEnabled(config.CUSTOM_REACT) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto React:* ${isEnabled(config.AUTO_REACT) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Delete Links:* ${isEnabled(config.DELETE_LINKS) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Anti-Link:* ${isEnabled(config.ANTI_LINK) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Anti-Bad Words:* ${isEnabled(config.ANTI_BAD) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Typing:* ${isEnabled(config.AUTO_TYPING) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Auto Recording:* ${isEnabled(config.AUTO_RECORDING) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Always Online:* ${isEnabled(config.ALWAYS_ONLINE) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Public Mode:* ${isEnabled(config.PUBLIC_MODE) ? "Enabled β " : "Disabled β"} | |
| βΰΉ *Read Message:* ${isEnabled(config.READ_MESSAGE) ? "Enabled β " : "Disabled β"} | |
| β°ββββββββββββββββ· | |
| > ${config.DESCRIPTION}`; | |
| // Send message with an image | |
| await conn.sendMessage( | |
| from, | |
| { | |
| image: { url: 'https://i.postimg.cc/yNf7rQFw/prn.jpg' }, // Image URL | |
| caption: envSettings, | |
| contextInfo: { | |
| mentionedJid: [m.sender], | |
| forwardingScore: 999, | |
| isForwarded: true, | |
| forwardedNewsletterMessageInfo: { | |
| newsletterJid: '120363304325601080@newsletter', | |
| newsletterName: "βοΈγ πππππππ ππ γβοΈ", | |
| serverMessageId: 143 | |
| } | |
| } | |
| }, | |
| { quoted: mek } | |
| ); | |
| // Send an audio file | |
| await conn.sendMessage(from, { | |
| audio: { url: 'https://github.com/mrfrank-ofc/SUBZERO-MD-DATABASE/blob/main/audios/subzero-menu.mp3' }, // Audio URL | |
| mimetype: 'audio/mp4', | |
| ptt: true | |
| }, { quoted: mek }); | |
| } catch (error) { | |
| console.log(error); | |
| reply(`Error: ${error.message}`); | |
| } | |
| }); | |