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