File size: 3,516 Bytes
046b271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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: ["setting", "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 = `╭━━━〔 *𓆩ုαͺ³π€π‹πˆ-πŒπƒα€Ύαͺ³π“†ͺ* γ€•β”β”β”ˆβŠ·
┃▸╭───────────···๏
β”ƒβ–Έβ”œβ’ *βš™οΈENV SETTINGSβš™οΈ*
┃▸└───────────···๏
β•°β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”ˆβŠ·
╭━━〔 *Enabled Disabled* γ€•β”β”ˆβŠ·
β”œβ’ *Status View:* ${isEnabled(config.AUTO_STATUS_SEEN) ? "Enabled βœ…" : "Disabled ❌"}
β”œβ’ *Status Reply:* ${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 ❌"}
β”œβ’ *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 ❌"}
β”œβ’ *Status React:* ${isEnabled(config.AUTO_STATUS_REACT) ? "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://cdn.ironman.my.id/i/2du3i5.jpg' }, // Image URL
                caption: envSettings,
                contextInfo: {
                    mentionedJid: [m.sender],
                    forwardingScore: 999,
                    isForwarded: true,
                    forwardedNewsletterMessageInfo: {
                        newsletterJid: '120363318387454868@newsletter',
                        newsletterName: "𝐀ɭīī 𝐌Ɗ π’ΚŠΜŠππΰΉαΦŸΙΌΚˆ  βƒͺπŸ€–αͺ³αͺ³ΝŽπ†Ό",
                        serverMessageId: 143
                    }
                }
            },
            { quoted: mek }
        );

               // Send an audio file
        await conn.sendMessage(from, {
            audio: { url: 'https://cdn.ironman.my.id/i/hmxjch.mp4' }, // Audio URL
            mimetype: 'audio/mp4',
            ptt: true
        }, { quoted: mek });

    } catch (error) {
        console.log(error);
        reply(`Error: ${error.message}`);
    }
});