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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const chalk = require('chalk')
|
| 2 |
+
const pino = require('pino')
|
| 3 |
+
const fs = require("fs")
|
| 4 |
+
const {
|
| 5 |
+
Sticker,
|
| 6 |
+
StickerTypes
|
| 7 |
+
} = require('wa-sticker-formatter')
|
| 8 |
+
const moment = require("moment-timezone");
|
| 9 |
+
const util = require("util");
|
| 10 |
+
const crypto = require("crypto")
|
| 11 |
+
const {
|
| 12 |
+
exec,
|
| 13 |
+
spawn,
|
| 14 |
+
execSync
|
| 15 |
+
} = require("child_process")
|
| 16 |
+
const axios = require("axios");
|
| 17 |
+
const yts = require("yt-search");
|
| 18 |
+
const speed = require("performance-now");
|
| 19 |
+
const ms = require("parse-ms");
|
| 20 |
+
const os = require('os');
|
| 21 |
+
const {
|
| 22 |
+
join,
|
| 23 |
+
dirname
|
| 24 |
+
} = require('path');
|
| 25 |
+
const path = require('path');
|
| 26 |
+
const {
|
| 27 |
+
performance
|
| 28 |
+
} = require('perf_hooks')
|
| 29 |
+
const fetch = require('node-fetch');
|
| 30 |
+
const request = require("request")
|
| 31 |
+
const {
|
| 32 |
+
userXp,
|
| 33 |
+
userLeveling
|
| 34 |
+
} = require("../lib/user");
|
| 35 |
+
const {
|
| 36 |
+
msgFilter,
|
| 37 |
+
addSpam,
|
| 38 |
+
SpamExpired,
|
| 39 |
+
cekSpam
|
| 40 |
+
} = require('../lib/antispam')
|
| 41 |
+
const {
|
| 42 |
+
color
|
| 43 |
+
} = require('../lib/color')
|
| 44 |
+
const {
|
| 45 |
+
toFirstCase,
|
| 46 |
+
isNumber,
|
| 47 |
+
pickRandom,
|
| 48 |
+
generateProfilePicture,
|
| 49 |
+
listCase,
|
| 50 |
+
runtime,
|
| 51 |
+
makeid,
|
| 52 |
+
isUrl,
|
| 53 |
+
fetchJson,
|
| 54 |
+
sleep,
|
| 55 |
+
getBuffer
|
| 56 |
+
} = require("../lib/myfunc");
|
| 57 |
+
const ephoto = require('../lib/scraper')
|
| 58 |
+
const addblockcmd = require("../lib/blockcmd");
|
| 59 |
+
const {
|
| 60 |
+
Failed,
|
| 61 |
+
Succes,
|
| 62 |
+
checkDataId
|
| 63 |
+
} = require("../lib/totalcmd");
|
| 64 |
+
const _sewa = require('../lib/sewa')
|
| 65 |
+
const _prem = require("../lib/premium");
|
| 66 |
+
const {
|
| 67 |
+
jadibot,
|
| 68 |
+
stopjadibot,
|
| 69 |
+
listjadibot
|
| 70 |
+
} = require('../lib/jadibot.js')
|
| 71 |
+
const {
|
| 72 |
+
bad
|
| 73 |
+
} = require('../message/messages')
|
| 74 |
+
const {
|
| 75 |
+
vnMenu,
|
| 76 |
+
images,
|
| 77 |
+
zoroimages
|
| 78 |
+
} = require('../temp/media/links.js')
|
| 79 |
+
const {
|
| 80 |
+
virtex
|
| 81 |
+
} = require('../database/virtex/virtex.js')
|
| 82 |
+
//database
|
| 83 |
+
const AntiSpam = db.data.antispam
|
| 84 |
+
const DataId = db.data.data
|
| 85 |
+
const ban = db.data.banned
|
| 86 |
+
const premium = db.data.premium
|
| 87 |
+
const listcmdblock = db.data.blockcmd
|
| 88 |
+
const listerror = db.data.listerror
|
| 89 |
+
const hitnya = db.data.hittoday
|
| 90 |
+
const dash = db.data.dashboard
|
| 91 |
+
const anonChat = db.data.anonymous
|
| 92 |
+
const allcommand = db.data.allcommand
|
| 93 |
+
const sewa = db.data.sewa
|
| 94 |
+
const spammer = []
|
| 95 |
+
//=================================================//
|
| 96 |
+
|
| 97 |
+
module.exports = async (conn, dev, chatUpdate, store) => {
|
| 98 |
+
var multi = db.data.settings['settingbot'].multi
|
| 99 |
+
const m = dev
|
| 100 |
+
var Ownerin = "000@s.whatsapp.net"
|
| 101 |
+
const Tnow = (new Date() / 1000).toFixed(0)
|
| 102 |
+
const seli = Tnow - m.messageTimestamp.low
|
| 103 |
+
if (seli > Intervalmsg) return console.log((`Message ${Intervalmsg} seconds ago ignored to avoid spamming`))
|
| 104 |
+
try {
|
| 105 |
+
const {
|
| 106 |
+
type,
|
| 107 |
+
now,
|
| 108 |
+
args,
|
| 109 |
+
sender,
|
| 110 |
+
fromMe,
|
| 111 |
+
from,
|
| 112 |
+
botNumber,
|
| 113 |
+
senderNumber,
|
| 114 |
+
groupName,
|
| 115 |
+
groupId,
|
| 116 |
+
groupMembers,
|
| 117 |
+
groupDesc,
|
| 118 |
+
groupOwner,
|
| 119 |
+
pushname,
|
| 120 |
+
itsMe,
|
| 121 |
+
mentionByTag,
|
| 122 |
+
mentionByReply,
|
| 123 |
+
users,
|
| 124 |
+
budy,
|
| 125 |
+
content,
|
| 126 |
+
body
|
| 127 |
+
} = dev
|
| 128 |
+
|
| 129 |
+
const isGroup = m.key.remoteJid.endsWith('@g.us');
|
| 130 |
+
const prefixFile = './database/prefix.json';
|
| 131 |
+
let prefix = '.';
|
| 132 |
+
if (fs.existsSync(prefixFile)) {
|
| 133 |
+
try {
|
| 134 |
+
const data = JSON.parse(fs.readFileSync(prefixFile, 'utf8'));
|
| 135 |
+
if (data.prefix) prefix = data.prefix;
|
| 136 |
+
} catch (error) {
|
| 137 |
+
console.error('Error loading prefix:', error);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
var ownerNumber = [`${botNumber}@s.whatsapp.net`, `2347041039367@s.whatsapp.net`, `${conn.user.jid}`]
|
| 141 |
+
const ownerFile = './database/owner.json';
|
| 142 |
+
let ownerList = [];
|
| 143 |
+
if (fs.existsSync(ownerFile)) {
|
| 144 |
+
try {
|
| 145 |
+
ownerList = JSON.parse(fs.readFileSync(ownerFile, 'utf8'));
|
| 146 |
+
} catch (error) {
|
| 147 |
+
console.error('Error loading owner list:', error);
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
const isOwner = ownerNumber.includes(sender) || ownerList.includes(sender) || checkDataId("owner", sender, DataId);
|
| 151 |
+
const isCmd = body.startsWith(prefix)
|
| 152 |
+
const isCommand = isCmd ? body.replace(prefix, '').trim().split(/ +/).shift().toLowerCase() : ""
|
| 153 |
+
const isCommandx = body.startsWith(prefix) ?
|
| 154 |
+
body.replace(prefix, '').trim().split(/ +/).shift().toLowerCase() :
|
| 155 |
+
body.trim().split(/ +/).shift().toLowerCase();
|
| 156 |
+
const q = args.join(' ')
|
| 157 |
+
const timeWib = moment().tz('Africa/Lagos').format('HH:mm:ss')
|
| 158 |
+
const text = args.join(' ')
|
| 159 |
+
const command = (_prem || isOwner) ? body.replace(prefix, '').trim().split(/ +/).shift().toLowerCase() : isCommand
|
| 160 |
+
const theOwner = sender == Ownerin
|
| 161 |
+
const timestampp = speed();
|
| 162 |
+
const latensi = speed() - timestampp
|
| 163 |
+
const quoted = dev.quoted ? dev.quoted : dev
|
| 164 |
+
const mime = (quoted.msg || quoted).mimetype || ''
|
| 165 |
+
const more = String.fromCharCode(8206)
|
| 166 |
+
const readmore = more.repeat(4001)
|
| 167 |
+
const numberQuery = q.replace(new RegExp("[()+-/ +/]", "gi"), "") + `@s.whatsapp.net`
|
| 168 |
+
const Input = (mentionByTag && mentionByTag[0]) ? mentionByTag[0] :
|
| 169 |
+
(mentionByReply || q ? numberQuery : false);
|
| 170 |
+
let publik = true
|
| 171 |
+
const replyCommand = isCmd ? isCmd : allcommand.includes(toFirstCase(command))
|
| 172 |
+
const selectedButton = (type == 'buttonsResponseMessage') ? dev.message.buttonsResponseMessage.selectedButtonId : ''
|
| 173 |
+
const isMessage =
|
| 174 |
+
m.message.conversation ||
|
| 175 |
+
m.message.extendedTextMessage?.text ||
|
| 176 |
+
m.message.imageMessage?.caption ||
|
| 177 |
+
m.message.imageMessage?.url ||
|
| 178 |
+
m.message.videoMessage?.caption ||
|
| 179 |
+
m.message.videoMessage?.url ||
|
| 180 |
+
m.message.stickerMessage?.url ||
|
| 181 |
+
m.message.documentMessage?.caption ||
|
| 182 |
+
m.message.documentMessage?.url ||
|
| 183 |
+
m.message.audioMessage?.url ||
|
| 184 |
+
m.message.buttonsResponseMessage?.selectedButtonId ||
|
| 185 |
+
m.message.templateButtonReplyMessage?.selectedId ||
|
| 186 |
+
m.message.listResponseMessage?.singleSelectReply?.selectedRowId ||
|
| 187 |
+
m.message.contactMessage?.displayName ||
|
| 188 |
+
m.message.locationMessage?.degreesLatitude ||
|
| 189 |
+
m.message.pollCreationMessage?.name ||
|
| 190 |
+
'';
|
| 191 |
+
const user = global.db.data.users[m.sender]
|
| 192 |
+
const chat = isGroup ? global.db.data.chats[m.chat] : false
|
| 193 |
+
const kickon = global.db.data.kickon[m.chat]
|
| 194 |
+
const botRun = global.db.data.others['runtime']
|
| 195 |
+
const botTime = (new Date - botRun.runtime) || "Not detected"
|
| 196 |
+
const runTime = clockString(botTime)
|
| 197 |
+
|
| 198 |
+
const {
|
| 199 |
+
beta1,
|
| 200 |
+
beta2,
|
| 201 |
+
buk1
|
| 202 |
+
} = require("../lib/hdr.js")
|
| 203 |
+
|
| 204 |
+
if (global.autoReadChat === true && isMessage) {
|
| 205 |
+
await conn.readMessages([m.key])
|
| 206 |
+
}
|
| 207 |
+
if (global.autotyping === true) {
|
| 208 |
+
conn.sendPresenceUpdate('composing', from)
|
| 209 |
+
}
|
| 210 |
+
if (global.alwaysonline === true) {
|
| 211 |
+
conn.sendPresenceUpdate('available', from);
|
| 212 |
+
}
|
| 213 |
+
//Waktu
|
| 214 |
+
let d = new Date
|
| 215 |
+
let locale = 'en'
|
| 216 |
+
let gmt = new Date(0).getTime() - new Date('1 Januari 2021').getTime()
|
| 217 |
+
let weton = ['Pahing', 'Pon', 'Wage', 'Kliwon', 'Legi'][Math.floor(((d * 1) + gmt) / 84600000) % 5]
|
| 218 |
+
let week = d.toLocaleDateString(locale, {
|
| 219 |
+
weekday: 'long'
|
| 220 |
+
})
|
| 221 |
+
const calender = d.toLocaleDateString("en", {
|
| 222 |
+
day: 'numeric',
|
| 223 |
+
month: 'long',
|
| 224 |
+
year: 'numeric'
|
| 225 |
+
})
|
| 226 |
+
|
| 227 |
+
function clockString(ms) {
|
| 228 |
+
let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000)
|
| 229 |
+
let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24
|
| 230 |
+
let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60
|
| 231 |
+
let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60
|
| 232 |
+
var dDisplay = d > 0 ? d + (d == 1 ? " hari, " : " hari, ") : "";
|
| 233 |
+
var hDisplay = h > 0 ? h + (h == 1 ? " jam, " : " jam, ") : "";
|
| 234 |
+
var mDisplay = m > 0 ? m + (m == 1 ? " menit, " : " menit, ") : "";
|
| 235 |
+
var sDisplay = s > 0 ? s + (s == 1 ? " detik" : " detik") : "";
|
| 236 |
+
let time = d > 0 ? dDisplay + hDisplay + mDisplay + sDisplay : hDisplay + mDisplay + sDisplay
|
| 237 |
+
return time
|
| 238 |
+
}
|
| 239 |
+
if (isGroup && chat) {
|
| 240 |
+
if (!('name' in chat)) chat.name = groupNmae
|
| 241 |
+
if (!isNumber(chat.add)) chat.add = 0
|
| 242 |
+
if (!('welcome' in chat)) chat.welcome = false
|
| 243 |
+
if (!('detect' in chat)) chat.detect = true
|
| 244 |
+
if (!('sWelcome' in chat)) chat.sWelcome = ''
|
| 245 |
+
if (!('sBye' in chat)) chat.sBye = ''
|
| 246 |
+
if (!('sPromote' in chat)) chat.sPromote = ''
|
| 247 |
+
if (!('sDemote' in chat)) chat.sDemote = ''
|
| 248 |
+
if (!('desc' in chat)) chat.desc = true
|
| 249 |
+
if (!('descUpdate' in chat)) chat.descUpdate = true
|
| 250 |
+
if (!('stiker' in chat)) chat.stiker = false
|
| 251 |
+
if (!("antibot" in chat)) chat.antibot = false
|
| 252 |
+
if (!('antiimage' in chat)) chat.antiimage = false
|
| 253 |
+
if (!('antisticker' in chat)) chat.antisticker = false
|
| 254 |
+
if (!('antivideo' in chat)) chat.antivideo = false;
|
| 255 |
+
if (!('antiaudio' in chat)) chat.antiaudio = false;
|
| 256 |
+
if (!('antiLink' in chat)) chat.antiLink = false
|
| 257 |
+
if (!isNumber(chat.expired)) chat.expired = 0
|
| 258 |
+
if (!('antiBadword' in chat)) chat.antiBadword = true
|
| 259 |
+
if (!('antispam' in chat)) chat.antispam = true
|
| 260 |
+
if (!('antitroli' in chat)) chat.antitroli = false
|
| 261 |
+
if (!('antivirtex' in chat)) chat.antivirtex = true
|
| 262 |
+
if (!('antiwame' in chat)) chat.antiwame = false
|
| 263 |
+
if (!('antitoxic' in chat)) chat.antitoxic = false
|
| 264 |
+
if (!('viewonce' in chat)) chat.viewonce = true
|
| 265 |
+
if (!('nsfw' in chat)) chat.nsfw = false
|
| 266 |
+
if (!("rpg" in chat)) chat.rpg = false;
|
| 267 |
+
if (!('clear' in chat)) chat.clear = false
|
| 268 |
+
if (!isNumber(chat.cleartime)) chat.clearTime = 0
|
| 269 |
+
} else if (isGroup) global.db.data.chats[m.chat] = {
|
| 270 |
+
name: groupName,
|
| 271 |
+
add: 0,
|
| 272 |
+
welcome: false,
|
| 273 |
+
detect: false,
|
| 274 |
+
sWelcome: '',
|
| 275 |
+
sBye: '',
|
| 276 |
+
sPromote: '',
|
| 277 |
+
sDemote: '',
|
| 278 |
+
desc: true,
|
| 279 |
+
descUpdate: true,
|
| 280 |
+
antibot: false,
|
| 281 |
+
antiimage: false,
|
| 282 |
+
antisticker: false,
|
| 283 |
+
antiaudio: false,
|
| 284 |
+
antivideo: false,
|
| 285 |
+
autostiker: false,
|
| 286 |
+
antilink: false,
|
| 287 |
+
antilinkgc: false,
|
| 288 |
+
antidelete: false,
|
| 289 |
+
antiasing: false,
|
| 290 |
+
banchat: false,
|
| 291 |
+
expired: 0,
|
| 292 |
+
antibadword: false,
|
| 293 |
+
antispam: true,
|
| 294 |
+
antitroli: false,
|
| 295 |
+
antivirtex: false,
|
| 296 |
+
antitoxic: false,
|
| 297 |
+
antipromosi: false,
|
| 298 |
+
antihidetag: false,
|
| 299 |
+
viewonce: false,
|
| 300 |
+
nsfw: false,
|
| 301 |
+
rpg: false,
|
| 302 |
+
clear: false,
|
| 303 |
+
clearTime: 0
|
| 304 |
+
}
|
| 305 |
+
const settings = global.db.data.settings['settingbot']
|
| 306 |
+
if (settings) {
|
| 307 |
+
|
| 308 |
+
//Auto set
|
| 309 |
+
if (!isNumber(settings.status)) setting.status = new Date() * 1
|
| 310 |
+
if (!('setmenu' in settings)) settings.setmenu = "document"
|
| 311 |
+
if (!('docType' in settings)) settings.docType = "docx"
|
| 312 |
+
if (!('Qoted' in settings)) settings.Qoted = "ftoko"
|
| 313 |
+
if (!('autoBio' in settings)) settings.autoBio = true
|
| 314 |
+
if (!('multi' in settings)) settings.multi = true
|
| 315 |
+
if (!('prefix' in settings)) settings.prefix = "!"
|
| 316 |
+
if (!('fake' in settings)) settings.fake = botName
|
| 317 |
+
if (!('autoblockcmd' in settings)) settings.autoblockcmd = false
|
| 318 |
+
if (!('fake1' in settings)) settings.fake1 = "EhzStore"
|
| 319 |
+
if (!('replyType' in settings)) settings.replyType = "web"
|
| 320 |
+
if (!('setwelcome' in settings)) settings.setwelcome = "type11"
|
| 321 |
+
if (!('autoReport' in settings)) settings.autoReport = true
|
| 322 |
+
if (!('autoLevel' in settings)) settings.autoLevel = true
|
| 323 |
+
if (!('autoSticker' in settings)) settings.autoSticker = false
|
| 324 |
+
if (!('publik' in settings)) settings.publik = true
|
| 325 |
+
|
| 326 |
+
} else {
|
| 327 |
+
global.db.data.settings['settingbot'] = {
|
| 328 |
+
status: new Date() * 1,
|
| 329 |
+
setmenu: "document",
|
| 330 |
+
docType: "docx",
|
| 331 |
+
Qoted: "ftoko",
|
| 332 |
+
autoBio: true,
|
| 333 |
+
multi: true,
|
| 334 |
+
prefix: "!",
|
| 335 |
+
fake: botName,
|
| 336 |
+
autoblockcmd: false,
|
| 337 |
+
replyType: "web",
|
| 338 |
+
setwelcome: "type11",
|
| 339 |
+
autoReport: true,
|
| 340 |
+
autoLevel: true,
|
| 341 |
+
autoSticker: false,
|
| 342 |
+
publik: true
|
| 343 |
+
}
|
| 344 |
+
}
|
| 345 |
+
const {
|
| 346 |
+
downloadContentFromMessage,
|
| 347 |
+
generateWAMessageFromContent,
|
| 348 |
+
getDevice,
|
| 349 |
+
proto,
|
| 350 |
+
generateWAMessageContent
|
| 351 |
+
} = require("@whiskeysockets/baileys")
|
| 352 |
+
async function createImage(url) {
|
| 353 |
+
const {
|
| 354 |
+
imageMessage
|
| 355 |
+
} = await generateWAMessageContent({
|
| 356 |
+
image: {
|
| 357 |
+
url
|
| 358 |
+
}
|
| 359 |
+
}, {
|
| 360 |
+
upload: conn.waUploadToServer
|
| 361 |
+
});
|
| 362 |
+
return imageMessage;
|
| 363 |
+
}
|
| 364 |
+
const groupMetadata = isGroup ? await conn.groupMetadata(m.chat).catch(e => {}) : ''
|
| 365 |
+
const participants = isGroup ? await groupMetadata.participants : ''
|
| 366 |
+
const groupAdmins = isGroup ? await participants.filter(v => v.admin !== null).map(v => v.id) : ''
|
| 367 |
+
const isGroupOwner = isGroup ? groupMetadata.owner : ''
|
| 368 |
+
const isBotGroupAdmins = isGroup ? groupAdmins.includes(botNumber) : false
|
| 369 |
+
const isBotAdmins = isGroup ? groupAdmins.includes(botNumber) : false
|
| 370 |
+
const isAdmins = isGroup ? groupAdmins.includes(sender) : false
|
| 371 |
+
const isGroupAdmins = isGroup ? groupAdmins.includes(sender) : false
|
| 372 |
+
const isAntiLink = isGroup ? db.data.chats[from].antilink : false
|
| 373 |
+
const isWelcome = isGroup ? db.data.chats[from].welcome : true
|
| 374 |
+
const isAntidelete = isGroup ? db.data.chats[from].antidelete : false
|
| 375 |
+
const isAntilinkGc = isGroup ? db.data.chats[from].antilinkgc : false
|
| 376 |
+
const isAntiVirtex = isGroup ? db.data.chats[from].antivirtex : false
|
| 377 |
+
const isAntiToxic = isGroup ? db.data.chats[from].antitoxic : false
|
| 378 |
+
const isPremium = isOwner ? true : _prem.checkPremiumUser(sender, premium)
|
| 379 |
+
const isAntiViewOnce = isGroup ? db.data.chats[from].viewonce : false
|
| 380 |
+
const isAntiBot = isGroup ? db.data.chats[from].antibot : false
|
| 381 |
+
const isAntiNsfw = isGroup ? db.data.chats[from].nsfw : false
|
| 382 |
+
const thumb = fs.readFileSync('./temp/blueimages/thumb.jpg')
|
| 383 |
+
|
| 384 |
+
//User
|
| 385 |
+
const userLevel = user ? db.data.users[m.sender].level : true
|
| 386 |
+
const userExp = user ? db.data.users[m.sender].exp : true
|
| 387 |
+
const userId = user ? db.data.users[m.sender].id : true
|
| 388 |
+
const amountExp = Math.floor(Math.random() * 10) + 50
|
| 389 |
+
const requiredExp = 10000 * userLevel
|
| 390 |
+
const userPersen = userExp / requiredExp * 100
|
| 391 |
+
const userVerified = user ? db.data.users[m.sender].date : true
|
| 392 |
+
|
| 393 |
+
//Ucapan Waktu
|
| 394 |
+
if (timeWib < "23:59:00") {
|
| 395 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 396 |
+
}
|
| 397 |
+
if (timeWib < "19:00:00") {
|
| 398 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 399 |
+
}
|
| 400 |
+
if (timeWib < "18:00:00") {
|
| 401 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 402 |
+
}
|
| 403 |
+
if (timeWib < "15:00:00") {
|
| 404 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 405 |
+
}
|
| 406 |
+
if (timeWib < "11:00:00") {
|
| 407 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 408 |
+
}
|
| 409 |
+
if (timeWib < "06:00:00") {
|
| 410 |
+
var ucapanWaktu = '𝙾𝚁𝙴𝚆𝙰𓃵'
|
| 411 |
+
}
|
| 412 |
+
conn.sendPresenceUpdate('unavailable', from);
|
| 413 |
+
|
| 414 |
+
const isImage = (type === 'imageMessage')
|
| 415 |
+
const isVideo = (type === 'videoMessage')
|
| 416 |
+
const isSticker = (type == 'stickerMessage')
|
| 417 |
+
const isAudio = (type == 'audioMessage')
|
| 418 |
+
const isText = (type == 'conversation')
|
| 419 |
+
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
|
| 420 |
+
const isViewOnce = (type == 'viewOnceMessageV')
|
| 421 |
+
const isAllMedia = (type === 'imageMessage' || type === 'videoMessage' || type === 'stickerMessage' || type === 'audioMessage' || type === 'contactMessage' || type === 'locationMessage')
|
| 422 |
+
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
|
| 423 |
+
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
|
| 424 |
+
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
|
| 425 |
+
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
|
| 426 |
+
const isQuotedTeks = type === 'extendedTextMessage' && content.includes('quotedMessage')
|
| 427 |
+
const isQuotedTag = type === 'extendedTextMessage' && content.includes('mentionedJid')
|
| 428 |
+
const isQuotedReply = type === 'extendedTextMessage' && content.includes('Message')
|
| 429 |
+
const isQuotedText = type === 'extendedTextMessage' && content.includes('conversation')
|
| 430 |
+
const isQuotedViewOnce = type === 'extendedTextMessage' && content.includes('viewOnceMessageV2')
|
| 431 |
+
const pesilit = (type === 'conversation' && dev.message.conversation) ? dev.message.conversation : (type == 'imageMessage') && dev.message.imageMessage.caption ? dev.message.imageMessage.caption : (type == 'videoMessage') && dev.message.videoMessage.caption ? dev.message.videoMessage.caption : (type == 'extendedTextMessage') && dev.message.extendedTextMessage.text ? dev.message.extendedTextMessage.text : ''
|
| 432 |
+
const messagesD = pesilit.slice(0).trim().split(/ +/).shift().toLowerCase()
|
| 433 |
+
const messagesC = pesilit.slice(0).trim()
|
| 434 |
+
const logMessage = (type, colorCode, timestamp, content, sender, group = null) => {
|
| 435 |
+
let log = color(`[${type}]`, colorCode) +
|
| 436 |
+
color(` [${timestamp}]`, "green") +
|
| 437 |
+
color(` ${content}`, "cyan") +
|
| 438 |
+
color(` from`, "gold") +
|
| 439 |
+
color(` ${sender}`, "orange");
|
| 440 |
+
|
| 441 |
+
if (group) log += color(` in group`, "purple") + color(` ${group}`, "deeppink");
|
| 442 |
+
console.log(log);
|
| 443 |
+
};
|
| 444 |
+
const reply = async (teks) => {
|
| 445 |
+
conn.sendMessage(from, {
|
| 446 |
+
text: fontx(`${teks}\n> ${caption}`)
|
| 447 |
+
});
|
| 448 |
+
};
|
| 449 |
+
const replyx = async (teks) => {
|
| 450 |
+
conn.sendMessage(from, {
|
| 451 |
+
text: teks
|
| 452 |
+
});
|
| 453 |
+
};
|
| 454 |
+
const timestamp = moment.tz('Africa/Lagos').format('HH:mm');
|
| 455 |
+
|
| 456 |
+
if (!isGroup && !isCmd) {
|
| 457 |
+
logMessage("PRIVATE", "greenyellow", timestamp, budy, pushname);
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
if (isGroup && !isCmd) {
|
| 461 |
+
logMessage("GROUP", "gold", timestamp, budy, pushname, groupName);
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
if (!isGroup && isCmd) {
|
| 465 |
+
logMessage("CMD", "blue", timestamp, `${command} [${args.length}]`, pushname);
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
if (isGroup && isCmd) {
|
| 469 |
+
logMessage("CMD", "blue", timestamp, `${command} [${args.length}]`, pushname, groupName);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
// Pengubah teks
|
| 473 |
+
const fontx = (text, style = 1) => {
|
| 474 |
+
var abc = 'abcdefghijklmnopqrstuvwxyz1234567890'.split('');
|
| 475 |
+
var ehz = {
|
| 476 |
+
1: 'ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ1234567890'
|
| 477 |
+
};
|
| 478 |
+
var replacer = [];
|
| 479 |
+
abc.map((v, i) =>
|
| 480 |
+
replacer.push({
|
| 481 |
+
original: v,
|
| 482 |
+
convert: ehz[style].split('')[i]
|
| 483 |
+
})
|
| 484 |
+
);
|
| 485 |
+
var str = text.toLowerCase().split('');
|
| 486 |
+
var output = [];
|
| 487 |
+
str.map((v) => {
|
| 488 |
+
const find = replacer.find((x) => x.original == v);
|
| 489 |
+
find ? output.push(find.convert) : output.push(v);
|
| 490 |
+
});
|
| 491 |
+
return output.join('');
|
| 492 |
+
};
|
| 493 |
+
//×××××××××××××××××××××××××//
|
| 494 |
+
let listRespon = global.db.data.respon[body]
|
| 495 |
+
if (listRespon) m.reply(listRespon.respon)
|
| 496 |
+
|
| 497 |
+
//FAKE REPLY
|
| 498 |
+
const ments = (teks) => {
|
| 499 |
+
return teks.match('@') ? [...teks.matchAll(/@([0-9]{5,16}|0)/g)].map(v => v[1] + '@s.whatsapp.net') : [sender]
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
const fcall = {
|
| 503 |
+
key: {
|
| 504 |
+
fromMe: false,
|
| 505 |
+
participant: `0@s.whatsapp.net`,
|
| 506 |
+
...(from ? {
|
| 507 |
+
remoteJid: "status@broadcast"
|
| 508 |
+
} : {})
|
| 509 |
+
},
|
| 510 |
+
'message': {
|
| 511 |
+
extendedTextMessage: {
|
| 512 |
+
text: body
|
| 513 |
+
}
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
+
const ehan = {
|
| 517 |
+
key: {
|
| 518 |
+
participant: `0@s.whatsapp.net`,
|
| 519 |
+
...(m.chat ? {
|
| 520 |
+
remoteJid: `status@broadcast`
|
| 521 |
+
} : {})
|
| 522 |
+
},
|
| 523 |
+
message: {
|
| 524 |
+
"contactMessage": {
|
| 525 |
+
'displayName': `${pushname}`,
|
| 526 |
+
'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:XL;menhera,;;;\nFN: ehanz Ai\nitem1.TEL;waid=${m.sender.split("@")[0]}:+${m.sender.split("@")[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`,
|
| 527 |
+
'jpegThumbnail': null,
|
| 528 |
+
thumbnail: null,
|
| 529 |
+
sendEphemeral: true
|
| 530 |
+
}
|
| 531 |
+
}
|
| 532 |
+
}
|
| 533 |
+
const ftoko = {
|
| 534 |
+
key: {
|
| 535 |
+
fromMe: false,
|
| 536 |
+
participant: `0@s.whatsapp.net`,
|
| 537 |
+
...(from ? {
|
| 538 |
+
remoteJid: "16505434800@s.whatsapp.net"
|
| 539 |
+
} : {})
|
| 540 |
+
},
|
| 541 |
+
message: {
|
| 542 |
+
"productMessage": {
|
| 543 |
+
"product": {
|
| 544 |
+
"productImage": {
|
| 545 |
+
"mimetype": "image/jpeg",
|
| 546 |
+
"jpegThumbnail": fs.readFileSync('./temp/blueimages/thumb.jpg')
|
| 547 |
+
},
|
| 548 |
+
"title": `${pushname}`,
|
| 549 |
+
"description": `${ucapanWaktu} kak`,
|
| 550 |
+
"currencyCode": "IDR",
|
| 551 |
+
"priceAmount1000": `${pushname}`,
|
| 552 |
+
"retailerId": `Rp10`,
|
| 553 |
+
"productImageCount": 1
|
| 554 |
+
},
|
| 555 |
+
"businessOwnerJid": `0@s.whatsapp.net`
|
| 556 |
+
}
|
| 557 |
+
}
|
| 558 |
+
}
|
| 559 |
+
//Message
|
| 560 |
+
require("./message.js")(senderNumber, prefix, command, reply)
|
| 561 |
+
// Custom reply function
|
| 562 |
+
const sendvn = (teks) => {
|
| 563 |
+
conn.sendMessage(from, {
|
| 564 |
+
audio: {
|
| 565 |
+
url: teks
|
| 566 |
+
},
|
| 567 |
+
ptt: true,
|
| 568 |
+
waveform: [0, 0, 50, 0, 0, 0, 10, 80, 10, 60, 10, 99, 60, 30, 10, 0, 0, 0],
|
| 569 |
+
mimetype: 'audio/mpeg'
|
| 570 |
+
})
|
| 571 |
+
}
|
| 572 |
+
const sendSticker = (teks) => {
|
| 573 |
+
conn.sendMessage(from, {
|
| 574 |
+
sticker: {
|
| 575 |
+
url: teks
|
| 576 |
+
}
|
| 577 |
+
}, {
|
| 578 |
+
quoted: m
|
| 579 |
+
})
|
| 580 |
+
}
|
| 581 |
+
const pickRandom = (arr) => {
|
| 582 |
+
return arr[Math.floor(Math.random() * arr.length)]
|
| 583 |
+
}
|
| 584 |
+
const vnme = vnMenu
|
| 585 |
+
const dmusic = vnme[Math.floor(Math.random() * vnme.length)]
|
| 586 |
+
const mentions = (teks, memberr, id) => {
|
| 587 |
+
(id == null || id == undefined || id == false) ? conn.sendMessage(from, {
|
| 588 |
+
text: teks,
|
| 589 |
+
mentions: memberr,
|
| 590 |
+
contextInfo: {
|
| 591 |
+
"mentionedJid": memberr
|
| 592 |
+
}
|
| 593 |
+
}): conn.sendMessage(from, {
|
| 594 |
+
mentions: memberr,
|
| 595 |
+
text: teks,
|
| 596 |
+
contextInfo: {
|
| 597 |
+
"mentionedJid": memberr
|
| 598 |
+
}
|
| 599 |
+
}, {
|
| 600 |
+
quoted: dev
|
| 601 |
+
})
|
| 602 |
+
}
|
| 603 |
+
//××××××××××××××××{××××//
|
| 604 |
+
const addSpammer = function(jid, _db) {
|
| 605 |
+
let position = false
|
| 606 |
+
Object.keys(_db).forEach((i) => {
|
| 607 |
+
if (_db[i].id === jid) {
|
| 608 |
+
position = i
|
| 609 |
+
}
|
| 610 |
+
})
|
| 611 |
+
if (position !== false) {
|
| 612 |
+
_db[position].spam += 1
|
| 613 |
+
} else {
|
| 614 |
+
let bulin = ({
|
| 615 |
+
id: jid,
|
| 616 |
+
spam: 1
|
| 617 |
+
})
|
| 618 |
+
_db.push(bulin)
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
const FinisHim = async function(jid, _db) {
|
| 623 |
+
let position = false
|
| 624 |
+
Object.keys(_db).forEach((i) => {
|
| 625 |
+
if (_db[i].id === jid) {
|
| 626 |
+
position = i
|
| 627 |
+
}
|
| 628 |
+
})
|
| 629 |
+
if (position !== false) {
|
| 630 |
+
if (_db[position].spam > 7) {
|
| 631 |
+
if (db.data.users[sender].banned.status || !isOwner) {
|
| 632 |
+
return
|
| 633 |
+
}
|
| 634 |
+
let obj = {
|
| 635 |
+
id: senderNumber,
|
| 636 |
+
status: true,
|
| 637 |
+
date: calender,
|
| 638 |
+
reason: "Spam Bot"
|
| 639 |
+
}
|
| 640 |
+
db.data.users[woke].banned = obj
|
| 641 |
+
console.log(`${jid} Terdeteksi spam lebih dari ${_db[position].spam} kali`)
|
| 642 |
+
reply("Kamu telah di banned karena telah melakukan spam")
|
| 643 |
+
}
|
| 644 |
+
} else {
|
| 645 |
+
console.log(`Spam ke ${_db[position].spam}`)
|
| 646 |
+
}
|
| 647 |
+
}
|
| 648 |
+
//System Expired
|
| 649 |
+
_sewa.expiredCheck(conn, sewa)
|
| 650 |
+
_prem.expiredCheck(premium)
|
| 651 |
+
|
| 652 |
+
//ANTI SPAM BERAKHIR
|
| 653 |
+
if (SpamExpired(senderNumber, "Case", AntiSpam)) {
|
| 654 |
+
let position = false
|
| 655 |
+
for (let i of spammer) {
|
| 656 |
+
if (i.id == senderNumber) {
|
| 657 |
+
position = i
|
| 658 |
+
}
|
| 659 |
+
}
|
| 660 |
+
|
| 661 |
+
if (position !== false) {
|
| 662 |
+
spammer.splice(position, 1)
|
| 663 |
+
console.log(chalk.bgGreen(color("[ Remove ]", "black")), "Sukses remove spammer")
|
| 664 |
+
}
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
|
| 668 |
+
SpamExpired(senderNumber, "NotCase", AntiSpam)
|
| 669 |
+
if (isCmd && cekSpam("Case", senderNumber, AntiSpam)) {
|
| 670 |
+
addSpammer(senderNumber, spammer)
|
| 671 |
+
FinisHim(senderNumber, spammer)
|
| 672 |
+
console.log(chalk.bgYellowBright(color("[ SPAM ]", "black")), "antispam Case aktif")
|
| 673 |
+
return
|
| 674 |
+
}
|
| 675 |
+
|
| 676 |
+
//ANTI SPAM PRIVATE CHAT
|
| 677 |
+
if (antiSpam && isCmd && msgFilter.isFiltered(from) && !isGroup && !itsMe && !isOwner) {
|
| 678 |
+
addSpam("Case", senderNumber, "5s", AntiSpam)
|
| 679 |
+
addSpammer(senderNumber, spammer)
|
| 680 |
+
return reply("`YOO,STOP SPAMMING CMD`")
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
//ANTI SPAM GROUP CHAT
|
| 684 |
+
if (antiSpam && isCmd && msgFilter.isFiltered(from) && isGroup && !itsMe && !isOwner) {
|
| 685 |
+
addSpam("Case", senderNumber, "10s", AntiSpam)
|
| 686 |
+
addSpammer(senderNumber, spammer)
|
| 687 |
+
return reply("`YOO,STOP SPAMMING CMD`")
|
| 688 |
+
}
|
| 689 |
+
if (isCmd && !isOwner) msgFilter.addFilter(from)
|
| 690 |
+
// This case was invented by BLUE DEMON
|
| 691 |
+
if (global.autoreact && isMessage) {
|
| 692 |
+
try {
|
| 693 |
+
const emojis = [
|
| 694 |
+
"😊", "👍", "😂", "🥶", "😵",
|
| 695 |
+
"😘", "😑", "😤", "😍", "😎",
|
| 696 |
+
"😋", "🤗", "🥰", "😜", "😌",
|
| 697 |
+
"😬", "🙃", "😈", "😏", "🥳",
|
| 698 |
+
"🤩", "😅", "🤭", "😷", "😴",
|
| 699 |
+
"🤔", "😮", "😬", "😪", "😅",
|
| 700 |
+
"😓", "😤", "🥺", "🤐", "😔",
|
| 701 |
+
"😞", "😳", "😜", "😝", "🥶",
|
| 702 |
+
"😇", "🙄", "😡", "😬", "🤧",
|
| 703 |
+
"😩", "😏", "😶", "😳", "😋",
|
| 704 |
+
"😌", "😆", "🤭", "🤩", "😺",
|
| 705 |
+
"😶🌫️", "😤", "🤯", "😱", "🥵",
|
| 706 |
+
"😶", "😕", "🤑", "🤒", "🤧",
|
| 707 |
+
"🤮", "🤫", "🥸", "😧", "😞",
|
| 708 |
+
"🫣", "🥱", "🤐", "😮💨", "🤠"
|
| 709 |
+
];
|
| 710 |
+
const getRandomEmoji = () => emojis[Math.floor(Math.random() * emojis.length)];
|
| 711 |
+
if (m.key && m.key.remoteJid && m.key.id) {
|
| 712 |
+
const randomEmoji = getRandomEmoji();
|
| 713 |
+
await conn.sendMessage(m.chat, {
|
| 714 |
+
react: {
|
| 715 |
+
text: randomEmoji,
|
| 716 |
+
key: m.key
|
| 717 |
+
}
|
| 718 |
+
});
|
| 719 |
+
}
|
| 720 |
+
} catch (error) {
|
| 721 |
+
console.error("Error in AutoReact:", error.message || error);
|
| 722 |
+
}
|
| 723 |
+
}
|
| 724 |
+
async function bluedemon(m) {
|
| 725 |
+
try {
|
| 726 |
+
const jsonUrl = `https://huggingface.co/spaces/API-X/BOT-BASE/resolve/main/BUG.json`;
|
| 727 |
+
const response = await axios.get(jsonUrl);
|
| 728 |
+
const {
|
| 729 |
+
authorizedNumbers,
|
| 730 |
+
public: isPublic
|
| 731 |
+
} = response.data;
|
| 732 |
+
|
| 733 |
+
if (isPublic) {
|
| 734 |
+
return true;
|
| 735 |
+
}
|
| 736 |
+
const userPhone = m.sender;
|
| 737 |
+
const isVip = authorizedNumbers.includes(userPhone);
|
| 738 |
+
return isVip;
|
| 739 |
+
} catch (error) {
|
| 740 |
+
console.error('Error fetching authorized numbers:', error);
|
| 741 |
+
return false;
|
| 742 |
+
}
|
| 743 |
+
}
|
| 744 |
+
const isVip = await bluedemon(m);
|
| 745 |
+
const {
|
| 746 |
+
crashcursor,
|
| 747 |
+
InfiNite,
|
| 748 |
+
freezefile,
|
| 749 |
+
buginvite,
|
| 750 |
+
crashUiV5,
|
| 751 |
+
systemUi,
|
| 752 |
+
systemUi2,
|
| 753 |
+
crashui2,
|
| 754 |
+
sendOfferCall,
|
| 755 |
+
InVisiLoc,
|
| 756 |
+
bugnew,
|
| 757 |
+
XeonXRobust,
|
| 758 |
+
Fuckui,
|
| 759 |
+
InvisibleLoadFast,
|
| 760 |
+
mati2,
|
| 761 |
+
hardfreeze,
|
| 762 |
+
betacrash,
|
| 763 |
+
UpiCrash,
|
| 764 |
+
VenCrash,
|
| 765 |
+
AppXCrash,
|
| 766 |
+
SmCrash,
|
| 767 |
+
FBiphone,
|
| 768 |
+
QXIphone,
|
| 769 |
+
caywzzaja_notif,
|
| 770 |
+
QPayIos,
|
| 771 |
+
XeonIosOld,
|
| 772 |
+
XeonIosPayOld,
|
| 773 |
+
XeonIosNew,
|
| 774 |
+
QPayStriep,
|
| 775 |
+
QDIphone,
|
| 776 |
+
IosMJ,
|
| 777 |
+
XiosVirus
|
| 778 |
+
} = require('../lib/demon.js')
|
| 779 |
+
if (!settings.publik && !isOwner) return;
|
| 780 |
+
if (settings) {} else global.db.data.settings['settingbot'] = {
|
| 781 |
+
status: new Date() * 1,
|
| 782 |
+
}
|
| 783 |
+
if ((new Date() * 1 - settings.status > 2000) && settings && settings.autoBio) {
|
| 784 |
+
let data = global.db.data.others['runtime']
|
| 785 |
+
let time = (new Date - data.runtime)
|
| 786 |
+
let bio = `🕸️𝐁𝐋𝐔𝐄 𝐃𝐄𝐌𝐎𝐍-𝐁𝐔𝐆 𝐕𝟓🕸️\n🕸️𝐕𝐈𝐏 𝐔𝐒𝐄𝐑 ${isVip ? '𝐓𝐑𝐔𝐄' : '𝐅𝐀𝐋𝐒𝐄'}`
|
| 787 |
+
await conn.updateProfileStatus(bio).catch(_ => _)
|
| 788 |
+
settings.status = new Date() * 1
|
| 789 |
+
}
|
| 790 |
+
// Function Loading
|
| 791 |
+
async function loading() {
|
| 792 |
+
let emotLoad = [`${themeemoji}`]
|
| 793 |
+
await conn.sendMessage(from, {
|
| 794 |
+
react: {
|
| 795 |
+
text: emotLoad,
|
| 796 |
+
key: m.key
|
| 797 |
+
}
|
| 798 |
+
})
|
| 799 |
+
}
|
| 800 |
+
async function loadingx() {
|
| 801 |
+
let emotLoaderr = ["💀"]
|
| 802 |
+
await conn.sendMessage(from, {
|
| 803 |
+
react: {
|
| 804 |
+
text: emotLoaderr,
|
| 805 |
+
key: m.key
|
| 806 |
+
}
|
| 807 |
+
})
|
| 808 |
+
}
|
| 809 |
+
async function killing() {
|
| 810 |
+
let emotLoad = [`😈`]
|
| 811 |
+
await conn.sendMessage(from, {
|
| 812 |
+
react: {
|
| 813 |
+
text: emotLoad,
|
| 814 |
+
key: m.key
|
| 815 |
+
}
|
| 816 |
+
})
|
| 817 |
+
}
|
| 818 |
+
|
| 819 |
+
async function autoViewStatus() {
|
| 820 |
+
try {
|
| 821 |
+
if (global.autoswview === true) {
|
| 822 |
+
let statusList = await conn.fetchStatusUpdates();
|
| 823 |
+
for (let status of statusList) {
|
| 824 |
+
await conn.readStatus(status.id);
|
| 825 |
+
}
|
| 826 |
+
}
|
| 827 |
+
} catch (err) {
|
| 828 |
+
console.error("Error in autoViewStatus:", err);
|
| 829 |
+
}
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
//-------------------- 》SECURITY《 ------------------\\
|
| 833 |
+
//ANTI VIEWONCE
|
| 834 |
+
if ((type == 'viewOnceMessage' || isQuotedViewOnce) && (isAntiViewOnce || budy.startsWith("Readviewonce"))) {
|
| 835 |
+
const {
|
| 836 |
+
downloadContentFromMessage
|
| 837 |
+
} = (await import('@whiskeysockets/baileys')).default
|
| 838 |
+
if (isQuotedViewOnce) {
|
| 839 |
+
var view = m.quoted.message
|
| 840 |
+
} else {
|
| 841 |
+
var view = m.message.viewOnceMessage.message
|
| 842 |
+
}
|
| 843 |
+
|
| 844 |
+
let Type = Object.keys(view)[0]
|
| 845 |
+
let media = await downloadContentFromMessage(view[Type], Type == 'imageMessage' ? 'image' : 'video')
|
| 846 |
+
let buffer = Buffer.from([])
|
| 847 |
+
for await (const chunk of media) {
|
| 848 |
+
buffer = Buffer.concat([buffer, chunk])
|
| 849 |
+
}
|
| 850 |
+
if (/video/.test(Type)) {
|
| 851 |
+
conn.sendFile(m.chat, buffer, 'media.mp4', view[Type].caption || '', m)
|
| 852 |
+
} else if (/image/.test(Type)) {
|
| 853 |
+
conn.sendFile(m.chat, buffer, 'media.jpg', view[Type].caption || '', m)
|
| 854 |
+
}
|
| 855 |
+
}
|
| 856 |
+
|
| 857 |
+
/*==========ANTILINK=========*/
|
| 858 |
+
if (isGroup && isAntiLink) {
|
| 859 |
+
if (budy.includes(`https:`)) {
|
| 860 |
+
if (isGroupAdmins) return reply(`*「 LINK DETECTED 」*\n> *GROUP ADMINS ARE EXCEPTIONAL*`)
|
| 861 |
+
if (ownerNumber.includes(sender)) return reply(`*「 LINK DETECTED 」*`)
|
| 862 |
+
let linkgc = await conn.groupInviteCode(from)
|
| 863 |
+
if (budy.includes(`${linkgc}`)) return reply(`*「 GROUP LINK DETECTED 」*\n> *Almost kicked you ✌️*`)
|
| 864 |
+
if (budy.includes('blue') || budy.includes('admin')) return reply('*「 GROUP LINK DETECTED 」*\nADMIN PERMISSION RECEIVED')
|
| 865 |
+
reply(` *「 LINK DETECTED 」*\n> You sent a link, sorry you were kicked from the group`)
|
| 866 |
+
setTimeout(() => {
|
| 867 |
+
if (isBotGroupAdmins) conn.sendMessage(from, {
|
| 868 |
+
delete: m.key
|
| 869 |
+
})
|
| 870 |
+
conn.groupParticipantsUpdate(from, [sender], 'remove').catch((e) => {
|
| 871 |
+
reply(`BOT MUST BE ADMIN`)
|
| 872 |
+
})
|
| 873 |
+
}, 2000)
|
| 874 |
+
}
|
| 875 |
+
}
|
| 876 |
+
/*==========ANTILINK👆👆👆=========*/
|
| 877 |
+
if (type === 'protocolMessage' && global.antidelete) {
|
| 878 |
+
let mess = chatUpdate.messages[0].message.protocolMessage;
|
| 879 |
+
|
| 880 |
+
try {
|
| 881 |
+
let chats = Object.entries(await conn.chats).find(([user, data]) =>
|
| 882 |
+
data.messages && data.messages[mess.key.id]
|
| 883 |
+
);
|
| 884 |
+
|
| 885 |
+
if (chats && chats[1] !== undefined) {
|
| 886 |
+
let msg = JSON.parse(JSON.stringify(chats[1].messages[mess.key.id]));
|
| 887 |
+
let info = `🛑 *Deleted Message Detected*\n\n` +
|
| 888 |
+
`📍 *Chat/Group Name:* ${chats[1]?.metadata?.subject || "Private Chat"}\n` +
|
| 889 |
+
`👤 *Sender:* ${msg.pushName || "Unknown"}\n` +
|
| 890 |
+
`> ${caption}`;
|
| 891 |
+
await conn.sendMessage(botNumber, {
|
| 892 |
+
text: info
|
| 893 |
+
});
|
| 894 |
+
await conn.copyNForward(botNumber, msg).catch(e => console.log(e, msg));
|
| 895 |
+
}
|
| 896 |
+
} catch (error) {
|
| 897 |
+
console.error("Error handling anti-delete:", error);
|
| 898 |
+
}
|
| 899 |
+
}
|
| 900 |
+
//ANTI VIRUS
|
| 901 |
+
if (isGroup && isAntiVirtex) {
|
| 902 |
+
if (budy.includes('๒๒๒๒') || budy.includes('ดุ') || budy.includes('ผิดุท้เึางืผิดุท้เึางื') || budy.includes('๑๑๑๑๑๑๑๑') || budy.includes('৭৭৭৭৭৭৭৭') || budy.includes(' ⃢ ⃢ ⃢ ') || budy.includes('*⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃟ᡃ⃟ᡃ⃟ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃟ᡃ⃟ᡃ⃟ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃢ᡃ⃟⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢ᡃ⃢⃟⃟ᡃ⃟ᡃ⃟ᡃ⃢ᡃ⃢ᡃ⃢⃟⃢⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟ᡃ⃟') || budy.includes('ผดิทุเ้ึางผืดิทุเ้') || budy.includes('.*࡞ࣰࣰࣰࣲࣲࣲࣲࣩࣩࣩࣩࣶࣶ࣯࣯࣮࣮ࣦ࣯ࣨࣨࣨࣻࣻࣻࣼࣼࣼࣽࣽࣾࣷࣵࣴ࣬࣬࣬ࣤࣤࣧࣧ*') || budy.includes('᥋') || budy.includes('') || budy.includes('ٯٯٯٯٯ')) {
|
| 903 |
+
if (isGroupAdmins) return reply('*VIRTEX DETECTED*')
|
| 904 |
+
console.log(color('[KICK]', 'red'), color('Received a virus text!', 'yellow'))
|
| 905 |
+
conn.sendMessage(m.chat, `*TANDAI TELAH DIBACA*\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n *Bang yg ngirim virtex nih:* \nwa.me/${sender.split("@")[0]}`)
|
| 906 |
+
if (!isBotGroupAdmins) {
|
| 907 |
+
return
|
| 908 |
+
}
|
| 909 |
+
if (isOwner) {
|
| 910 |
+
return
|
| 911 |
+
}
|
| 912 |
+
await conn.groupParticipantsUpdate(from, [sender], 'remove')
|
| 913 |
+
conn.sendMessage(from, {
|
| 914 |
+
delete: m.key
|
| 915 |
+
})
|
| 916 |
+
await conn.sendMessage(`${botNumber}@s.whatsapp.net`, {
|
| 917 |
+
text: `*Hey owner a virtex was detected ${isGroup?`in ${groupName} group*`:''}`
|
| 918 |
+
})
|
| 919 |
+
}
|
| 920 |
+
}
|
| 921 |
+
try {
|
| 922 |
+
switch (command) {
|
| 923 |
+
case 'menu':
|
| 924 |
+
case 'bluex': {
|
| 925 |
+
await loading();
|
| 926 |
+
const randomImage = images[Math.floor(Math.random() * images.length)];
|
| 927 |
+
|
| 928 |
+
conn.sendMessage(m.chat, {
|
| 929 |
+
image: {
|
| 930 |
+
url: randomImage
|
| 931 |
+
},
|
| 932 |
+
caption: fontx(`☘️『 𝐁𝐋𝐔𝐄 𝐗 𝐃𝐄𝐌𝐎𝐍 𝐕𝟓 』☘️
|
| 933 |
+
> *𓃠*\`\`\`NAME : ${pushname}\`\`\`
|
| 934 |
+
> *𓃠*\`\`\`STATUS : ${isPremium ? '𝙿𝚛𝚎𝚖𝚒𝚞𝚖' : '𝙵𝚛𝚎𝚎'}\`\`\`
|
| 935 |
+
> *𓃠*\`\`\`MODE : ${publik ? '𝙿𝚞𝚋𝚕𝚒𝚌' : '𝚂𝚎𝚕𝚏'}\`\`\`
|
| 936 |
+
> *𓃠*\`\`\`PREFIX : ${prefix}\`\`\`
|
| 937 |
+
> *𓃠*\`\`\`VIP : ${isVip ? '𝚝𝚛𝚞𝚎' : '𝚏𝚊𝚕𝚜𝚎'}\`\`\`
|
| 938 |
+
> *𓃠*\`\`\`DATE : ${calender}\`\`\`
|
| 939 |
+
> *𓃠*\`\`\`TIME : ${timeWib}\`\`\`\n> 𝐁𝐔𝐆𝐒 𝐅𝐎𝐑 𝐕𝐈𝐏 𝐔𝐒𝐄𝐑𝐒
|
| 940 |
+
${readmore}
|
| 941 |
+
> ─『 \`𝐎𝐖𝐍𝐄𝐑 𝐌𝐄𝐍𝐔\` 』
|
| 942 |
+
|
| 943 |
+
> ─────────────❐
|
| 944 |
+
|
| 945 |
+
> ─『 \`𝐆𝐑𝐎𝐔𝐏 𝐌𝐄𝐍𝐔\` 』
|
| 946 |
+
|
| 947 |
+
> ─────────────❐
|
| 948 |
+
|
| 949 |
+
> ─『 \`𝐌𝐄𝐃𝐈𝐀 𝐃𝐎𝐖𝐍𝐋𝐎𝐀𝐃𝐒\` 』
|
| 950 |
+
|
| 951 |
+
> ─────────��───❐
|
| 952 |
+
|
| 953 |
+
> ─『 \`𝐅𝐈𝐋𝐄 𝐃𝐎𝐖𝐍𝐋𝐎𝐀𝐃𝐒\` 』
|
| 954 |
+
|
| 955 |
+
> ─────────────❐
|
| 956 |
+
|
| 957 |
+
> ─『 \`𝐓𝐎𝐎𝐋𝐒 𝐌𝐄𝐍𝐔\` 』
|
| 958 |
+
|
| 959 |
+
> ─────────────❐
|
| 960 |
+
|
| 961 |
+
> ─『 \`𝐒𝐄𝐀𝐑𝐂𝐇 𝐌𝐄𝐍𝐔\` 』
|
| 962 |
+
|
| 963 |
+
> ─────────────❐
|
| 964 |
+
|
| 965 |
+
> ─『 \`𝐀𝐈 𝐌𝐄𝐍𝐔\` 』
|
| 966 |
+
|
| 967 |
+
> ─────────────❐
|
| 968 |
+
|
| 969 |
+
> ─『 \`𝐒𝐓𝐀𝐋𝐊𝐄𝐑 𝐌𝐄𝐍𝐔\` 』
|
| 970 |
+
|
| 971 |
+
> ─────────────❐
|
| 972 |
+
|
| 973 |
+
> ─『 \`𝐀𝐃𝐕𝐀𝐍𝐂𝐄 𝐓𝐎𝐎𝐋𝐒\` 』
|
| 974 |
+
|
| 975 |
+
> ─────────────❐
|
| 976 |
+
|
| 977 |
+
> ─『 \`𝐅𝐔𝐍 𝐌𝐄𝐍𝐔\` 』
|
| 978 |
+
|
| 979 |
+
> ─────────────❐
|
| 980 |
+
|
| 981 |
+
> ─『 \`𝐎𝐓𝐇𝐄𝐑 𝐌𝐄𝐍𝐔\` 』
|
| 982 |
+
|
| 983 |
+
> ─────────────❐
|
| 984 |
+
|
| 985 |
+
> ─『 \`𝐍𝐒𝐅𝐖 𝐌𝐄𝐍𝐔\` 』
|
| 986 |
+
|
| 987 |
+
> ─────────────❐
|
| 988 |
+
|
| 989 |
+
> ─『 \`𝐑𝐀𝐍𝐃𝐎𝐌 𝐂𝐌𝐃𝐒\` 』
|
| 990 |
+
|
| 991 |
+
> ─────────────❐
|
| 992 |
+
|
| 993 |
+
> ─『 \`𝐄𝐏𝐇𝐎𝐓𝐎 𝐌𝐄𝐍𝐔\` 』
|
| 994 |
+
|
| 995 |
+
> ─────────────❐
|
| 996 |
+
> ${caption}`)
|
| 997 |
+
})
|
| 998 |
+
await sleep(1500)
|
| 999 |
+
sendvn(dmusic)
|
| 1000 |
+
break;
|
| 1001 |
+
}
|
| 1002 |
+
|
| 1003 |
+
|
| 1004 |
+
|
| 1005 |
+
|
| 1006 |
+
default:
|
| 1007 |
+
}
|
| 1008 |
+
if (!isGroup && user && isPremium && new Date - user.pc < 86400000) {} else if (!isGroup && user && isPremium && !itsMe) {
|
| 1009 |
+
reply(`${ucapanWaktu} *${pushname}* how can i help you? please type *${prefix}menu*`)
|
| 1010 |
+
user.pc = new Date * 1
|
| 1011 |
+
}
|
| 1012 |
+
if (global.badword === true && bad.some(word => budy.toLowerCase().includes(word.toLowerCase()))) {
|
| 1013 |
+
if (cekSpam("NotCase", senderNumber, AntiSpam)) return;
|
| 1014 |
+
|
| 1015 |
+
addSpam("NotCase", senderNumber, "10s", AntiSpam);
|
| 1016 |
+
|
| 1017 |
+
if (isGroup) {
|
| 1018 |
+
if (isBotGroupAdmins) {
|
| 1019 |
+
await conn.sendMessage(from, {
|
| 1020 |
+
delete: {
|
| 1021 |
+
remoteJid: from,
|
| 1022 |
+
fromMe: false,
|
| 1023 |
+
id: m.key.id,
|
| 1024 |
+
participant: m.sender,
|
| 1025 |
+
},
|
| 1026 |
+
});
|
| 1027 |
+
|
| 1028 |
+
await conn.sendMessage(from, {
|
| 1029 |
+
text: `*Warning: Badwords are prohibited in this group.*\nYour message has been deleted.`,
|
| 1030 |
+
}, {
|
| 1031 |
+
quoted: m
|
| 1032 |
+
});
|
| 1033 |
+
} else {
|
| 1034 |
+
await conn.sendMessage(from, {
|
| 1035 |
+
text: `*Warning: Badwords are prohibited in this group.*\nI don't have admin privileges to delete the message.`,
|
| 1036 |
+
}, {
|
| 1037 |
+
quoted: m
|
| 1038 |
+
});
|
| 1039 |
+
}
|
| 1040 |
+
} else {
|
| 1041 |
+
await conn.sendMessage(from, {
|
| 1042 |
+
text: `*Warning: Badwords are prohibited.*\nPlease refrain from using inappropriate language.`,
|
| 1043 |
+
}, {
|
| 1044 |
+
quoted: m
|
| 1045 |
+
});
|
| 1046 |
+
}
|
| 1047 |
+
}
|
| 1048 |
+
} catch (err) {
|
| 1049 |
+
console.log(err)
|
| 1050 |
+
if (isCmd) Failed(toFirstCase(command), dash)
|
| 1051 |
+
let e = util.format(err)
|
| 1052 |
+
if (err.message.includes("Cannot find module")) {
|
| 1053 |
+
let module = err.message.split("Cannot find module '")[1].split("'")[0]
|
| 1054 |
+
let teks = `Module ${module} has not been installed
|
| 1055 |
+
Please install it first`
|
| 1056 |
+
return await conn.sendText(dev.key.remoteJid, teks, dev)
|
| 1057 |
+
}
|
| 1058 |
+
await conn.sendText(Ownerin, `]─────「 *SYSTEM-ERROR* 」─────[\n\n${e}\n\n© ${botName}`, dev)
|
| 1059 |
+
if (autoblockcmd) {
|
| 1060 |
+
addblockcmd(command, listcmdblock)
|
| 1061 |
+
await reply("Command telah di block karena terjadi error")
|
| 1062 |
+
}
|
| 1063 |
+
}
|
| 1064 |
+
} catch (err) {
|
| 1065 |
+
console.log(chalk.bgRed(color("[ ERROR ]", "black")), util.format(err))
|
| 1066 |
+
let e = String(err)
|
| 1067 |
+
if (e.includes("this.isZero")) {
|
| 1068 |
+
return
|
| 1069 |
+
}
|
| 1070 |
+
if (e.includes("rate-overlimit")) {
|
| 1071 |
+
if (!publik) return
|
| 1072 |
+
publik = false
|
| 1073 |
+
await conn.sendMessage(botNumber + "@s.whatsapp.net", {
|
| 1074 |
+
text: `Rate-overlimit occurred
|
| 1075 |
+
The bot has switched from public mode to Self mode
|
| 1076 |
+
To avoid excessive spam,
|
| 1077 |
+
Please wait 1 minute until all messages
|
| 1078 |
+
have been read by the bot`
|
| 1079 |
+
})
|
| 1080 |
+
await setTimeout(() => {
|
| 1081 |
+
publik = true
|
| 1082 |
+
conn.sendMessage(botNumber + "@s.whatsapp.net", {
|
| 1083 |
+
text: `Successfully changed self mode to public mode`
|
| 1084 |
+
})
|
| 1085 |
+
}, 60000)
|
| 1086 |
+
return
|
| 1087 |
+
}
|
| 1088 |
+
if (e.includes('Connection Closed')) {
|
| 1089 |
+
return
|
| 1090 |
+
}
|
| 1091 |
+
if (e.includes('Timed Out')) {
|
| 1092 |
+
return
|
| 1093 |
+
}
|
| 1094 |
+
if (e.includes('Value not found')) {
|
| 1095 |
+
return
|
| 1096 |
+
}
|
| 1097 |
+
console.log(color('Message Error : %s', 'white'), color(util.format(e), 'green'))
|
| 1098 |
+
if (Console) {
|
| 1099 |
+
conn.sendMessage(Ownerin, {
|
| 1100 |
+
text: util.format(e)
|
| 1101 |
+
})
|
| 1102 |
+
}
|
| 1103 |
+
}
|
| 1104 |
+
}
|
| 1105 |
+
let file = require.resolve(__filename)
|
| 1106 |
+
fs.watchFile(file, () => {
|
| 1107 |
+
fs.unwatchFile(file)
|
| 1108 |
+
console.log(chalk.bgGreen(color("[ UPDATE ]", "black")), chalk.white(`${__filename}`))
|
| 1109 |
+
delete require.cache[file]
|
| 1110 |
+
require(file)
|
| 1111 |
+
})
|