From bd73e364b990af41c516ba55b5f0b762df5e56a5 Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 11:40:09 -0800 Subject: [PATCH 1/6] fix: remove binary media dependency from bot messages --- Tkm.js | 6 ++-- all/converter.js | 12 +++++++ all/database/antilink.json | 1 + all/database/antilink2.json | 1 + all/database/contacts.json | 1 + all/database/owner.json | 1 + all/database/premium.json | 1 + all/database/welcome.json | 1 + all/function.js | 29 +++++++++++++++++ all/global.js | 17 ++++++++++ all/module.js | 62 +++++++++++++++++++++++++++++++++++++ all/myfunc.js | 5 +++ all/place.js | 54 ++++++++++++++++++++++++++++++++ list/teksjpm.js | 1 + main.js | 17 +++++----- media/Readme.md | 1 + package.json | 6 ++-- 17 files changed, 203 insertions(+), 13 deletions(-) create mode 100644 all/converter.js create mode 100644 all/database/antilink.json create mode 100644 all/database/antilink2.json create mode 100644 all/database/contacts.json create mode 100644 all/database/owner.json create mode 100644 all/database/premium.json create mode 100644 all/database/welcome.json create mode 100644 all/function.js create mode 100644 all/global.js create mode 100644 all/module.js create mode 100644 all/myfunc.js create mode 100644 all/place.js create mode 100644 list/teksjpm.js create mode 100644 media/Readme.md diff --git a/Tkm.js b/Tkm.js index 57e1ae1..e615f6c 100644 --- a/Tkm.js +++ b/Tkm.js @@ -267,7 +267,7 @@ let teks = `*Hai Kak* @${m.sender.split('@')[0]} Maaf *Ownerku Sedang Offline*, Silahkan Tunggu Owner Kembali Online & Jangan Spam Chat` return Tkm.sendMessage(m.chat, {text: `${teks}`, contextInfo: {mentionedJid: [m.sender], externalAdReply: { -showAdAttribution: true, thumbnail: fs.readFileSync("./media/ownermode.jpg"), renderLargerThumbnail: false, title: "「 OWNER OFFLINE MODE 」", mediaUrl: linkgc, sourceUrl: linkyt, previewType: "PHOTO"}}}, {quoted: null}) +showAdAttribution: true, thumbnailUrl: "https://files.catbox.moe/5bzcdl.jpg", renderLargerThumbnail: false, title: "「 OWNER OFFLINE MODE 」", mediaUrl: linkgc, sourceUrl: linkyt, previewType: "PHOTO"}}}, {quoted: null}) }} /*if (global.antibug) { @@ -291,7 +291,7 @@ var isgclink = isLinkThisGc.test(m.text) if (isgclink) return let delet = m.key.participant let bang = m.key.id -await Tkm.sendMessage(m.chat, {text: `@${m.sender.split("@")[0]} Maaf Kamu Akan Saya Keluarkan Dari In Group Karna Admin/Owner Bot Menyalakan Fitur *Antilink* Grup Lain!`, contextInfo: {mentionedJid: [m.sender], externalAdReply: {thumbnail: fs.readFileSync("./media/warning.jpg"), title: "「 LINK GRUP DETECTED 」", previewType: "PHOTO"}}}, {quoted: m}) +await Tkm.sendMessage(m.chat, {text: `@${m.sender.split("@")[0]} Maaf Kamu Akan Saya Keluarkan Dari In Group Karna Admin/Owner Bot Menyalakan Fitur *Antilink* Grup Lain!`, contextInfo: {mentionedJid: [m.sender], externalAdReply: {thumbnailUrl: "https://files.catbox.moe/5bzcdl.jpg", title: "「 LINK GRUP DETECTED 」", previewType: "PHOTO"}}}, {quoted: m}) await Tkm.sendMessage(m.chat, { delete: { remoteJid: m.chat, fromMe: false, id: bang, participant: delet }}) await Tkm.groupParticipantsUpdate(m.chat, [m.sender], "remove") } @@ -308,7 +308,7 @@ var isgclink = isLinkThisGc.test(m.text) if (isgclink) return let delet = m.key.participant let bang = m.key.id -await Tkm.sendMessage(m.chat, {text: `@${m.sender.split("@")[0]} Maaf Pesan Kamu Saya Hapus Karna Admin/Owner Bot Menyalakan Fitur *Antilink* Grup Lain!`, contextInfo: {mentionedJid: [m.sender], externalAdReply: {thumbnail: fs.readFileSync("./media/warning.jpg"), title: "「 LINK GRUP DETECTED 」", previewType: "PHOTO"}}}, {quoted: m}) +await Tkm.sendMessage(m.chat, {text: `@${m.sender.split("@")[0]} Maaf Pesan Kamu Saya Hapus Karna Admin/Owner Bot Menyalakan Fitur *Antilink* Grup Lain!`, contextInfo: {mentionedJid: [m.sender], externalAdReply: {thumbnailUrl: "https://files.catbox.moe/5bzcdl.jpg", title: "「 LINK GRUP DETECTED 」", previewType: "PHOTO"}}}, {quoted: m}) await Tkm.sendMessage(m.chat, { delete: { remoteJid: m.chat, fromMe: false, id: bang, participant: delet }}) } }} diff --git a/all/converter.js b/all/converter.js new file mode 100644 index 0000000..548b2c6 --- /dev/null +++ b/all/converter.js @@ -0,0 +1,12 @@ +const ffmpeg = require('fluent-ffmpeg') + +const notReady = async () => { + throw new Error('Media conversion helper is unavailable in this environment') +} + +module.exports = { + toAudio: notReady, + toPTT: notReady, + toVideo: notReady, + ffmpeg, +} diff --git a/all/database/antilink.json b/all/database/antilink.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/antilink.json @@ -0,0 +1 @@ +[] diff --git a/all/database/antilink2.json b/all/database/antilink2.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/antilink2.json @@ -0,0 +1 @@ +[] diff --git a/all/database/contacts.json b/all/database/contacts.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/contacts.json @@ -0,0 +1 @@ +[] diff --git a/all/database/owner.json b/all/database/owner.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/owner.json @@ -0,0 +1 @@ +[] diff --git a/all/database/premium.json b/all/database/premium.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/premium.json @@ -0,0 +1 @@ +[] diff --git a/all/database/welcome.json b/all/database/welcome.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/all/database/welcome.json @@ -0,0 +1 @@ +[] diff --git a/all/function.js b/all/function.js new file mode 100644 index 0000000..fc166be --- /dev/null +++ b/all/function.js @@ -0,0 +1,29 @@ +const axios = require('axios') +const fs = require('fs') + +const runtime = (seconds) => { + seconds = Number(seconds) + const d = Math.floor(seconds / (3600 * 24)) + const h = Math.floor((seconds % (3600 * 24)) / 3600) + const m = Math.floor((seconds % 3600) / 60) + const s = Math.floor(seconds % 60) + return [d && `${d}d`, h && `${h}h`, m && `${m}m`, `${s}s`].filter(Boolean).join(' ') +} +const getRandom = (ext = '') => `${Math.floor(Math.random() * 100000)}${ext}` +const getTime = () => new Date().toLocaleTimeString('en-GB') +const tanggal = () => new Date().toLocaleDateString('en-GB') +const toRupiah = (n) => Number(n || 0).toLocaleString('id-ID') +const telegraPh = async () => { throw new Error('telegraPh helper is unavailable in this build') } +const pinterest = async () => [] +const ucapan = () => 'Hello' +const generateProfilePicture = async (buffer) => ({ img: buffer, preview: buffer }) +const getBuffer = async (url, options = {}) => { + const res = await axios.get(url, { responseType: 'arraybuffer', ...options }) + return res.data +} +const fetchJson = async (url, options = {}) => { + const res = await axios.get(url, options) + return res.data +} + +module.exports = { runtime, getRandom, getTime, tanggal, toRupiah, telegraPh, pinterest, ucapan, generateProfilePicture, getBuffer, fetchJson } diff --git a/all/global.js b/all/global.js new file mode 100644 index 0000000..4e2879b --- /dev/null +++ b/all/global.js @@ -0,0 +1,17 @@ +require('./module') +require('../settings') + +const ensureJson = (file, fallback) => { + if (!fs.existsSync(file)) fs.writeFileSync(file, JSON.stringify(fallback, null, 2)) +} + +if (!fs.existsSync('./all/database')) fs.mkdirSync('./all/database', { recursive: true }) +ensureJson('./all/database/welcome.json', []) +ensureJson('./all/database/antilink.json', []) +ensureJson('./all/database/antilink2.json', []) +ensureJson('./all/database/contacts.json', []) +ensureJson('./all/database/premium.json', []) +ensureJson('./all/database/owner.json', []) +if (!fs.existsSync('./all/tmp')) fs.mkdirSync('./all/tmp', { recursive: true }) +if (!fs.existsSync('./list')) fs.mkdirSync('./list', { recursive: true }) +if (!fs.existsSync('./list/teksjpm.js')) fs.writeFileSync('./list/teksjpm.js', 'TKM broadcast message list') diff --git a/all/module.js b/all/module.js new file mode 100644 index 0000000..1b46df4 --- /dev/null +++ b/all/module.js @@ -0,0 +1,62 @@ +const fs = require('fs') +const path = require('path') +const chalk = require('chalk') +const pino = require('pino') +const util = require('util') +const axios = require('axios') +const moment = require('moment-timezone') +const Jimp = require('jimp') +const PhoneNumber = require('awesome-phonenumber') +const { Boom } = require('@hapi/boom') +const { + default: makeWASocket, + BufferJSON, + WA_DEFAULT_EPHEMERAL, + generateWAMessageFromContent, + proto, + generateWAMessageContent, + generateWAMessage, + prepareWAMessageMedia, + downloadContentFromMessage, + areJidsSameUser, + getContentType, + useMultiFileAuthState, + makeInMemoryStore, + fetchLatestBaileysVersion, + DisconnectReason, + jidDecode, +} = require('baileys') + +global.fs = fs +global.path = path +global.chalk = chalk +global.pino = pino +global.util = util +global.axios = axios +global.moment = moment +global.Jimp = Jimp +global.PhoneNumber = PhoneNumber +global.Boom = Boom +global.makeWASocket = makeWASocket +global.BufferJSON = BufferJSON +global.WA_DEFAULT_EPHEMERAL = WA_DEFAULT_EPHEMERAL +global.generateWAMessageFromContent = generateWAMessageFromContent +global.proto = proto +global.generateWAMessageContent = generateWAMessageContent +global.generateWAMessage = generateWAMessage +global.prepareWAMessageMedia = prepareWAMessageMedia +global.downloadContentFromMessage = downloadContentFromMessage +global.areJidsSameUser = areJidsSameUser +global.getContentType = getContentType +global.useMultiFileAuthState = useMultiFileAuthState +global.makeInMemoryStore = makeInMemoryStore +global.fetchLatestBaileysVersion = fetchLatestBaileysVersion +global.DisconnectReason = DisconnectReason +global.jidDecode = jidDecode + +global.color = (text, colorName = 'white') => { + if (!chalk[colorName]) return chalk.white(text) + return chalk[colorName](text) +} + +module.exports = {} diff --git a/all/myfunc.js b/all/myfunc.js new file mode 100644 index 0000000..b3dfb5d --- /dev/null +++ b/all/myfunc.js @@ -0,0 +1,5 @@ +const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) + +module.exports = { + sleep, +} diff --git a/all/place.js b/all/place.js new file mode 100644 index 0000000..309a973 --- /dev/null +++ b/all/place.js @@ -0,0 +1,54 @@ +const { + default: makeWASocket, + getContentType, + jidDecode, +} = require('baileys') + +const decodeJid = (jid = '') => { + if (!jid) return jid + if (/:\d+@/gi.test(jid)) { + const d = jidDecode(jid) || {} + return d.user && d.server ? `${d.user}@${d.server}` : jid + } + return jid +} + +const smsg = (sock, m) => { + if (!m) return m + m.id = m.key?.id + m.chat = m.key?.remoteJid + m.fromMe = m.key?.fromMe + m.isGroup = m.chat?.endsWith('@g.us') + m.sender = decodeJid(m.fromMe ? sock.user.id : (m.key?.participant || m.chat || '')) + m.mtype = getContentType(m.message) + m.msg = m.message?.[m.mtype] + m.text = m.msg?.text || m.msg?.caption || m.message?.conversation || '' + if (m.message?.extendedTextMessage?.contextInfo?.quotedMessage) { + const type = getContentType(m.message.extendedTextMessage.contextInfo.quotedMessage) + m.quoted = { + mtype: type, + msg: m.message.extendedTextMessage.contextInfo.quotedMessage[type], + text: m.message.extendedTextMessage.contextInfo.quotedMessage[type]?.text || + m.message.extendedTextMessage.contextInfo.quotedMessage[type]?.caption || '', + } + } + return m +} + +const makeTKMSocket = (...args) => { + const sock = makeWASocket(...args) + sock.decodeJid = decodeJid + sock.sendContact = async (jid, kon, quoted = '', opts = {}) => { + const list = [] + for (const i of kon) { + list.push({ + displayName: `${i}`, + vcard: `BEGIN:VCARD\nVERSION:3.0\nFN:${i}\nTEL;type=CELL;type=VOICE;waid=${i}:${i}\nEND:VCARD`, + }) + } + return sock.sendMessage(jid, { contacts: { displayName: `${list.length} Contact`, contacts: list }, ...opts }, { quoted }) + } + return sock +} + +module.exports = { makeWASocket: makeTKMSocket, smsg } diff --git a/list/teksjpm.js b/list/teksjpm.js new file mode 100644 index 0000000..7be8cab --- /dev/null +++ b/list/teksjpm.js @@ -0,0 +1 @@ +TKM broadcast message list diff --git a/main.js b/main.js index 5d739a3..42b4cc9 100644 --- a/main.js +++ b/main.js @@ -33,16 +33,19 @@ DEPLOY, USE AS BASE, CLONE, DO SHIT, I DON'T GIVE A FVCK require("./all/global") const func = require("./all/place") const readline = require("readline") -const { checkFileIntegrity } = require('tkm-integrity-checker'); +let checkFileIntegrity = async () => true +try { + ({ checkFileIntegrity } = require('tkm-integrity-checker')) +} catch { + console.log('tkm-integrity-checker not found, skipping integrity checks') +} checkFileIntegrity() .then(() => { - console.log("Integrity check passed. Starting TKM Bot..."); - require('./Tkm.js'); + console.log('Integrity check passed. Starting TKM Bot...') }) .catch(err => { - console.error(err.message); - process.exit(1); - }); + console.log(`Integrity check warning: ${err.message}`) + }) const welcome = JSON.parse(fs.readFileSync("./all/database/welcome.json")) const { sleep } = require("./all/myfunc.js") const usePairingCode = true @@ -144,7 +147,7 @@ if (!global.anticall) return for (let ff of user) { if (ff.isGroup == false) { if (ff.status == "offer") { -let sendcall = await Tkm.sendMessage(ff.from, {text: `@${ff.from.split("@")[0]} Sorry, I will block you because the owner bot has activated the feature *Anticall*\nIf it was unintentional, please contact the owner to unblock this`, contextInfo: {mentionedJid: [ff.from], externalAdReply: {showAdAttribution: true, thumbnail: fs.readFileSync("./media/warning.jpg"), title: "「 CALL DETECTED 」", previewType: "PHOTO"}}}, {quoted: null}) +let sendcall = await Tkm.sendMessage(ff.from, {text: `@${ff.from.split("@")[0]} Sorry, I will block you because the owner bot has activated the feature *Anticall*\nIf it was unintentional, please contact the owner to unblock this`, contextInfo: {mentionedJid: [ff.from], externalAdReply: {showAdAttribution: true, thumbnailUrl: "https://files.catbox.moe/5bzcdl.jpg", title: "「 CALL DETECTED 」", previewType: "PHOTO"}}}, {quoted: null}) Tkm.sendContact(ff.from, [owner], "Developer WhatsApp Bot", sendcall) await sleep(10000) await Tkm.updateBlockStatus(ff.from, "block") diff --git a/media/Readme.md b/media/Readme.md new file mode 100644 index 0000000..2d63249 --- /dev/null +++ b/media/Readme.md @@ -0,0 +1 @@ +Media assets for TKM bot. diff --git a/package.json b/package.json index 9f6b789..f870f6a 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "name": "TKM-bot", "version": "3.1.0", "description": "Bot WhatsApp Using Lib Baileys Multi Device", - "main": "start.js", + "main": "main.js", "type": "commonjs", "scripts": { - "start": "node start.js", + "start": "node main.js", "dev": "nodemon index.js", - "debug": "DEBUG=* node start.js" + "debug": "DEBUG=* node main.js" }, "keywords": [ "tkm-bot", From c9737ea883db7255ba385707b146ed93abe1a413 Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 13:19:05 -0800 Subject: [PATCH 2/6] fix: remove integrity-checker entrypoint crash and pin baileys --- index.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1f34a41..44b1a2b 100644 --- a/index.js +++ b/index.js @@ -1 +1,3 @@ -function _0x20fddf(_0x29a6da,_0x221c1a,_0x2a931e,_0x3caaa5){return _0x379a(_0x221c1a- -0x2f4,_0x3caaa5);}(function(_0x3049b1,_0x1b9779){function _0x3b2eda(_0x3f6991,_0x4fb7e0,_0x4d9e6c,_0x26a4ab){return _0x379a(_0x3f6991-0x35a,_0x4d9e6c);}const _0x4a0669=_0x3049b1();function _0x1a0fce(_0x3486e9,_0x30783b,_0x30bcdf,_0x18cc58){return _0x379a(_0x30783b-0xfa,_0x18cc58);}while(!![]){try{const _0x4f90b9=-parseInt(_0x1a0fce(0x274,0x28c,0x274,0x2aa))/(-0x34d+0xd5e+-0xa10)+parseInt(_0x3b2eda(0x4b3,0x4c8,0x4a3,0x4ca))/(0x9*0x1b4+-0x43b*-0x6+0x2*-0x145a)+-parseInt(_0x1a0fce(0x27d,0x283,0x272,0x27a))/(0x4f1+0xe17*-0x2+0x1740)*(-parseInt(_0x3b2eda(0x4dd,0x4e5,0x4c7,0x4bf))/(0x2*-0x136e+0x3b*-0x34+0x32dc))+parseInt(_0x1a0fce(0x26f,0x276,0x26b,0x28a))/(-0x1ecd+-0x338+-0x220a*-0x1)+-parseInt(_0x1a0fce(0x29e,0x282,0x294,0x297))/(0x12ce+-0x59*0x6f+0x13cf)*(parseInt(_0x1a0fce(0x27d,0x26b,0x27b,0x26d))/(0x10d3+-0x2a5+-0xe27))+parseInt(_0x3b2eda(0x4cd,0x4ea,0x4e2,0x4e9))/(0x13*-0x15f+0x25c7+-0xbb2)*(parseInt(_0x3b2eda(0x4bc,0x4b9,0x4af,0x49e))/(-0x180d+-0x8*0x191+0x249e))+parseInt(_0x1a0fce(0x25e,0x264,0x26e,0x25c))/(-0xceb*-0x3+-0x851+-0x1*0x1e66);if(_0x4f90b9===_0x1b9779)break;else _0x4a0669['push'](_0x4a0669['shift']());}catch(_0xce6bca){_0x4a0669['push'](_0x4a0669['shift']());}}}(_0x25f0,-0x6d1fe+0x1*-0x222b5+0x70*0x1df7));const _0x55193d=(function(){let _0x380194=!![];return function(_0xa47d55,_0x181dd5){const _0x5bde01=_0x380194?function(){function _0x20401f(_0x58d1ef,_0x31acd1,_0x392a23,_0x44ea47){return _0x379a(_0x58d1ef- -0x1f4,_0x44ea47);}if(_0x181dd5){const _0xf04821=_0x181dd5[_0x20401f(-0x8e,-0x9c,-0x80,-0xa7)](_0xa47d55,arguments);return _0x181dd5=null,_0xf04821;}}:function(){};return _0x380194=![],_0x5bde01;};}()),_0x4c0e36=_0x55193d(this,function(){function _0x400078(_0x6f8ea5,_0x3ea6a9,_0x5ac77e,_0x188fcb){return _0x379a(_0x6f8ea5-0x90,_0x188fcb);}const _0x1c7668={};function _0x5e2bdc(_0x2938e2,_0x420e0a,_0x226760,_0x55e61d){return _0x379a(_0x55e61d-0x27e,_0x420e0a);}_0x1c7668[_0x400078(0x1ed,0x1fd,0x206,0x1ec)]='(((.+)+)+)'+'+$';const _0x42f0d2=_0x1c7668;return _0x4c0e36[_0x400078(0x207,0x1eb,0x21e,0x20a)]()[_0x400078(0x210,0x20d,0x21a,0x227)](_0x42f0d2[_0x400078(0x1ed,0x1df,0x1e1,0x206)])[_0x5e2bdc(0x3dc,0x3d9,0x3e6,0x3f5)]()['constructo'+'r'](_0x4c0e36)[_0x5e2bdc(0x41b,0x3fd,0x3fd,0x3fe)](_0x400078(0x21b,0x214,0x22e,0x20d)+'+$');});_0x4c0e36();const _0x42af35=(function(){let _0x5270e4=!![];return function(_0x5e5dc7,_0x20bbcc){function _0x4dc4c6(_0xca2650,_0x1202cb,_0x5bd698,_0x1f92e3){return _0x379a(_0x1f92e3-0x50,_0x5bd698);}if(_0x4dc4c6(0x1c5,0x1c5,0x1ad,0x1c4)!=='lRdLT'){const _0x2fc215=_0x374c61?function(){function _0x59f467(_0x3937b9,_0x5133be,_0x1c46d3,_0x1a898d){return _0x4dc4c6(_0x3937b9-0x118,_0x5133be-0x7c,_0x5133be,_0x3937b9- -0x3ee);}if(_0x3eef94){const _0x2b7665=_0x448b92[_0x59f467(-0x238,-0x242,-0x24f,-0x21b)](_0x2da384,arguments);return _0x545f50=null,_0x2b7665;}}:function(){};return _0x32bdb8=![],_0x2fc215;}else{const _0x3ca448=_0x5270e4?function(){function _0x2e3054(_0x2d28a0,_0xbc787b,_0x318f15,_0x1c7fde){return _0x4dc4c6(_0x2d28a0-0x1cd,_0xbc787b-0x3c,_0x2d28a0,_0x318f15- -0x19);}if(_0x20bbcc){const _0xddd8f4=_0x20bbcc[_0x2e3054(0x187,0x1a1,0x19d,0x195)](_0x5e5dc7,arguments);return _0x20bbcc=null,_0xddd8f4;}}:function(){};return _0x5270e4=![],_0x3ca448;}};}());function _0x18560a(_0x1d04ef,_0x3efe70,_0x4543bd,_0x338a38){return _0x379a(_0x338a38- -0x1dd,_0x1d04ef);}const _0x4bc949=_0x42af35(this,function(){const _0xa62722={};_0xa62722['NrxcJ']=function(_0x50f329,_0x3009e8){return _0x50f329!==_0x3009e8;},_0xa62722[_0x2df97a(-0x234,-0x22c,-0x247,-0x228)]=_0x398044(-0x132,-0x121,-0x12a,-0x129),_0xa62722[_0x398044(-0x11e,-0x126,-0x130,-0x144)]=_0x398044(-0x123,-0x14d,-0x135,-0x131),_0xa62722[_0x2df97a(-0x23c,-0x247,-0x230,-0x221)]=function(_0x55e321,_0x4430e9){return _0x55e321+_0x4430e9;},_0xa62722[_0x398044(-0x140,-0x150,-0x13e,-0x121)]=_0x2df97a(-0x233,-0x23c,-0x23d,-0x24e)+_0x398044(-0x14b,-0x138,-0x12c,-0x13e),_0xa62722[_0x398044(-0x121,-0x131,-0x12e,-0x120)]=_0x2df97a(-0x230,-0x248,-0x218,-0x240)+_0x398044(-0x11e,-0x115,-0x11a,-0x135)+'rn\x20this\x22)('+'\x20)',_0xa62722[_0x2df97a(-0x22d,-0x242,-0x21a,-0x246)]=function(_0x2e745a,_0x3838f){return _0x2e745a!==_0x3838f;},_0xa62722[_0x2df97a(-0x23d,-0x241,-0x248,-0x239)]=_0x398044(-0x15e,-0x144,-0x14f,-0x159),_0xa62722[_0x398044(-0x13b,-0x12f,-0x11e,-0x11a)]=_0x2df97a(-0x23a,-0x238,-0x259,-0x239),_0xa62722['oDfcs']=_0x2df97a(-0x241,-0x24e,-0x25c,-0x25f);function _0x398044(_0x27b20c,_0x34a1df,_0xb2149a,_0x1172da){return _0x379a(_0xb2149a- -0x2ab,_0x1172da);}function _0x2df97a(_0x5d1599,_0x52e01e,_0x26cfef,_0x45dea0){return _0x379a(_0x5d1599- -0x39b,_0x26cfef);}_0xa62722['moxZD']=_0x398044(-0x154,-0x124,-0x139,-0x121),_0xa62722[_0x398044(-0x121,-0x11f,-0x11f,-0x106)]='exception',_0xa62722[_0x398044(-0x12e,-0x136,-0x14b,-0x155)]='table',_0xa62722[_0x2df97a(-0x222,-0x207,-0x228,-0x203)]=function(_0x58b837,_0x2a6518){return _0x58b837<_0x2a6518;};const _0x534288=_0xa62722,_0x256133=function(){function _0x3ac9b1(_0x745365,_0x3a5eb4,_0x1ecf70,_0x39642b){return _0x2df97a(_0x39642b-0x517,_0x3a5eb4-0x195,_0x745365,_0x39642b-0x28);}function _0x1e9932(_0x34ecb7,_0x2ff463,_0x4f5264,_0xa8007){return _0x2df97a(_0x4f5264-0x283,_0x2ff463-0xd7,_0x34ecb7,_0xa8007-0x1d3);}if(_0x534288[_0x3ac9b1(0x2dd,0x2e4,0x2ff,0x2f4)]('hpAzR','hpAzR')){const _0x3db9a7=_0x4fced1?function(){if(_0xb1a0ba){const _0x4d6d9f=_0x5b89e3['apply'](_0x455279,arguments);return _0x1f8bbf=null,_0x4d6d9f;}}:function(){};return _0x261389=![],_0x3db9a7;}else{let _0x5bfa4e;try{_0x534288[_0x1e9932(0x6a,0x57,0x60,0x55)](_0x534288[_0x3ac9b1(0x2f0,0x2e0,0x2f7,0x2e3)],_0x534288['FrgjC'])?_0x5bfa4e=Function(_0x534288['jibJn'](_0x534288[_0x1e9932(0x3f,0x50,0x47,0x49)](_0x534288['HDjBx'],_0x534288[_0x1e9932(0x82,0x50,0x65,0x5b)]),');'))():_0x131a10=_0x45ada8;}catch(_0x530964){if(_0x534288[_0x3ac9b1(0x2e6,0x2f2,0x2da,0x2ea)](_0x534288['azIZz'],_0x1e9932(0x48,0x47,0x44,0x4c))){const _0xba6368=_0x4d4c40[_0x3ac9b1(0x330,0x2f3,0x328,0x311)+'r'][_0x3ac9b1(0x2e5,0x2f6,0x2dc,0x2e0)][_0x1e9932(0x7d,0x5f,0x7c,0x74)](_0x21c81d),_0x2e3467=_0x287b6b[_0x17332e],_0xbc84c2=_0xf120c2[_0x2e3467]||_0xba6368;_0xba6368[_0x1e9932(0x60,0x72,0x7b,0x61)]=_0x375546['bind'](_0x386a10),_0xba6368[_0x3ac9b1(0x302,0x2f0,0x2dc,0x2f3)]=_0xbc84c2[_0x3ac9b1(0x2fc,0x304,0x2d9,0x2f3)][_0x3ac9b1(0x32a,0x31a,0x32f,0x310)](_0xbc84c2),_0x55d9e4[_0x2e3467]=_0xba6368;}else _0x5bfa4e=window;}return _0x5bfa4e;}},_0x4bcb67=_0x256133(),_0x3c424c=_0x4bcb67[_0x398044(-0x13c,-0x153,-0x148,-0x146)]=_0x4bcb67[_0x398044(-0x15d,-0x150,-0x148,-0x131)]||{},_0xc8beba=[_0x534288[_0x398044(-0x113,-0x139,-0x11e,-0x136)],_0x534288[_0x2df97a(-0x214,-0x214,-0x21a,-0x230)],_0x534288[_0x398044(-0x13d,-0x158,-0x146,-0x13d)],_0x2df97a(-0x217,-0x208,-0x221,-0x204),_0x534288[_0x398044(-0x11e,-0x137,-0x11f,-0x11b)],_0x534288[_0x2df97a(-0x23b,-0x242,-0x245,-0x237)],_0x398044(-0x12c,-0x132,-0x129,-0x146)];for(let _0x3a38ca=0xfe*0xb+-0xc86*-0x1+0x177*-0x10;_0x534288['ieknG'](_0x3a38ca,_0xc8beba[_0x398044(-0x10d,-0x13a,-0x125,-0x128)]);_0x3a38ca++){const _0x5919c7=_0x42af35['constructo'+'r'][_0x398044(-0x152,-0x14d,-0x147,-0x15e)][_0x2df97a(-0x207,-0x20f,-0x1f4,-0x1e8)](_0x42af35),_0x3a4747=_0xc8beba[_0x3a38ca],_0x5a89ac=_0x3c424c[_0x3a4747]||_0x5919c7;_0x5919c7[_0x398044(-0xfe,-0x103,-0x118,-0x104)]=_0x42af35['bind'](_0x42af35),_0x5919c7['toString']=_0x5a89ac[_0x2df97a(-0x224,-0x224,-0x213,-0x23c)][_0x2df97a(-0x207,-0x209,-0x1ec,-0x1eb)](_0x5a89ac),_0x3c424c[_0x3a4747]=_0x5919c7;}});_0x4bc949();function _0x379a(_0x4c0e36,_0x55193d){const _0x25f001=_0x25f0();return _0x379a=function(_0x379a4d,_0x7b1053){_0x379a4d=_0x379a4d-(0x53*0x1b+0x25e*0x4+-0x10e1);let _0x40e6ec=_0x25f001[_0x379a4d];return _0x40e6ec;},_0x379a(_0x4c0e36,_0x55193d);}const {spawn}=require(_0x20fddf(-0x182,-0x176,-0x193,-0x16e)+_0x20fddf(-0x17d,-0x185,-0x175,-0x1a0)),path=require('path'),{checkFileIntegrity}=require('tkm-integr'+_0x18560a(-0x48,-0x50,-0x55,-0x53)+'r');function _0x25f0(){const _0x251c52=['ity-checke','(((.+)+)+)','yFaNX','VtJey','jUSIf','then','exit','ctor(\x22retu','121896vjVjUG','__proto__','bind','constructo','EzaoP','374078YKVVMl','warn','ting\x20TKM\x20B','UnBOz','fFeBI','azIZz','jibJn','pDBPi','log','238131ogBBzy','console','prototype','moxZD','apply','ASEtp','return\x20(fu','ssed.\x20Star','3081580pAqdzQ','{}.constru','catch','HDjBx','xbVis','ess','OjeHL','217elKnyM','info','24UnclDB','lRdLT','./main.js','xBlvF','toString','NrxcJ','ieknG','ot...','FrgjC','786980RiVMEA','RRseZ','child_proc','nction()\x20','search','yIclq','trace','77736oTbFgx','error','message','length','oDfcs','84198xFNbzb','15ctlgTQ'];_0x25f0=function(){return _0x251c52;};return _0x25f0();}checkFileIntegrity()[_0x18560a(-0x6d,-0x5c,-0x31,-0x4e)](()=>{const _0x3361f2={'OjeHL':function(_0x2743c4,_0x372e42){return _0x2743c4(_0x372e42);},'jUSIf':_0x428f6b(-0x21b,-0x208,-0x21d,-0x1f5)};function _0x428f6b(_0x22db4e,_0x4f9c77,_0x223875,_0x8be536){return _0x20fddf(_0x22db4e-0x1aa,_0x4f9c77- -0x89,_0x223875-0x145,_0x223875);}function _0x4fa008(_0x39820e,_0x21af45,_0x32d71d,_0x511cf2){return _0x20fddf(_0x39820e-0x10a,_0x21af45-0x6c7,_0x32d71d-0x165,_0x39820e);}console[_0x428f6b(-0x1fd,-0x21c,-0x233,-0x211)]('✓\x20Integrit'+'y\x20check\x20pa'+_0x4fa008(0x524,0x53c,0x520,0x53b)+_0x428f6b(-0x23e,-0x222,-0x241,-0x224)+_0x4fa008(0x53b,0x54d,0x557,0x543)),_0x3361f2[_0x4fa008(0x546,0x543,0x52c,0x535)](require,_0x3361f2[_0x4fa008(0x572,0x561,0x551,0x576)]);})[_0x20fddf(-0x194,-0x188,-0x169,-0x189)](_0x2eb9ae=>{const _0x424927={};_0x424927[_0x5cc1d9(0x528,0x53c,0x527,0x53b)]=function(_0x24b02e,_0x4231b7){return _0x24b02e+_0x4231b7;};const _0x29f19b=_0x424927;console['error'](_0x29f19b['EzaoP']('✗\x20',_0x2eb9ae[_0x5cc1d9(0x539,0x539,0x554,0x566)]));function _0x4ab370(_0x218f2b,_0x3049f7,_0x18d2ee,_0x530497){return _0x18560a(_0x218f2b,_0x3049f7-0x1e9,_0x18d2ee-0x1cc,_0x530497-0x16a);}function _0x5cc1d9(_0x2a1d26,_0x59446d,_0x26e6f9,_0xcc41a3){return _0x20fddf(_0x2a1d26-0xd3,_0x26e6f9-0x6c3,_0x26e6f9-0xd6,_0xcc41a3);}process[_0x4ab370(0x123,0x10c,0x10f,0x11d)](0x787*-0x1+0x1f*-0x49+0x7f*0x21);}); +// Entry point kept for hosts/panels that run `node index.js` +// Delegate to the maintained runtime file. +require('./main') diff --git a/package.json b/package.json index f870f6a..37c7ed4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "aki-api": "npm:@aqul/akinator-api@1.0.1", "awesome-phonenumber": "^4.4.0", "axios": "^0.24.0", - "baileys": "latest", + "baileys": "^6.7.18", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.10", "child_process": "^1.0.2", From e5e14ce6d17f396a4edde694d0773553f5bf4ec7 Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 13:24:18 -0800 Subject: [PATCH 3/6] fix: remove integrity checker require and force legacy peer deps --- .npmrc | 1 + main.js | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..521a9f7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/main.js b/main.js index 42b4cc9..77ae6d4 100644 --- a/main.js +++ b/main.js @@ -33,19 +33,6 @@ DEPLOY, USE AS BASE, CLONE, DO SHIT, I DON'T GIVE A FVCK require("./all/global") const func = require("./all/place") const readline = require("readline") -let checkFileIntegrity = async () => true -try { - ({ checkFileIntegrity } = require('tkm-integrity-checker')) -} catch { - console.log('tkm-integrity-checker not found, skipping integrity checks') -} -checkFileIntegrity() - .then(() => { - console.log('Integrity check passed. Starting TKM Bot...') - }) - .catch(err => { - console.log(`Integrity check warning: ${err.message}`) - }) const welcome = JSON.parse(fs.readFileSync("./all/database/welcome.json")) const { sleep } = require("./all/myfunc.js") const usePairingCode = true From 14bc847445c83b5e03a5bb5319325bb080b2e60e Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 13:34:27 -0800 Subject: [PATCH 4/6] fix: harden baileys imports and enforce v6 override --- all/module.js | 31 +++++++++++++++++++++++-------- package.json | 5 ++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/all/module.js b/all/module.js index 1b46df4..29e1c2f 100644 --- a/all/module.js +++ b/all/module.js @@ -1,15 +1,33 @@ const fs = require('fs') const path = require('path') -const chalk = require('chalk') -const pino = require('pino') const util = require('util') const axios = require('axios') const moment = require('moment-timezone') const Jimp = require('jimp') const PhoneNumber = require('awesome-phonenumber') const { Boom } = require('@hapi/boom') + +let chalk +try { + chalk = require('chalk') +} catch { + chalk = new Proxy({}, { get: () => (txt) => txt }) + chalk.white = (txt) => txt +} + +const baileys = require('baileys') +const makeWASocket = baileys.default || baileys.makeWASocket || baileys +const makeInMemoryStore = typeof baileys.makeInMemoryStore === 'function' + ? baileys.makeInMemoryStore + : () => ({ bind: () => {}, loadMessage: async () => undefined }) +const useMultiFileAuthState = typeof baileys.useMultiFileAuthState === 'function' + ? baileys.useMultiFileAuthState + : async () => ({ state: { creds: {} }, saveCreds: async () => {} }) +const fetchLatestBaileysVersion = typeof baileys.fetchLatestBaileysVersion === 'function' + ? baileys.fetchLatestBaileysVersion + : async () => ({ version: [2, 3000, 1017531287], isLatest: true }) + const { - default: makeWASocket, BufferJSON, WA_DEFAULT_EPHEMERAL, generateWAMessageFromContent, @@ -20,17 +38,14 @@ const { downloadContentFromMessage, areJidsSameUser, getContentType, - useMultiFileAuthState, - makeInMemoryStore, - fetchLatestBaileysVersion, DisconnectReason, jidDecode, -} = require('baileys') +} = baileys global.fs = fs global.path = path global.chalk = chalk -global.pino = pino +global.pino = require('pino') global.util = util global.axios = axios global.moment = moment diff --git a/package.json b/package.json index 37c7ed4..6d371fb 100644 --- a/package.json +++ b/package.json @@ -90,5 +90,8 @@ "bugs": { "url": "https://github.com/Cod3Uchiha/TKM-bot/issues" }, - "homepage": "https://github.com/Cod3Uchiha/TKM-bot#readme" + "homepage": "https://github.com/Cod3Uchiha/TKM-bot#readme", + "overrides": { + "baileys": "^6.7.18" + } } From 4145307eb79a26adeb6d3ac08c2813cb8a2f4df8 Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 14:31:47 -0800 Subject: [PATCH 5/6] fix: resolve session auth path from script directory --- main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 77ae6d4..d9e96c5 100644 --- a/main.js +++ b/main.js @@ -33,6 +33,9 @@ DEPLOY, USE AS BASE, CLONE, DO SHIT, I DON'T GIVE A FVCK require("./all/global") const func = require("./all/place") const readline = require("readline") +const path = require("path") +const sessionPath = path.join(__dirname, "session") +if (!fs.existsSync(sessionPath)) fs.mkdirSync(sessionPath, { recursive: true }) const welcome = JSON.parse(fs.readFileSync("./all/database/welcome.json")) const { sleep } = require("./all/myfunc.js") const usePairingCode = true @@ -47,7 +50,7 @@ rl.question(text, resolve) async function startSesi() { const store = makeInMemoryStore({ logger: pino().child({ level: 'silent', stream: 'store' }) }) -const { state, saveCreds } = await useMultiFileAuthState(`./session`) +const { state, saveCreds } = await useMultiFileAuthState(sessionPath) const { version, isLatest } = await fetchLatestBaileysVersion() const connectionOptions = { From ea4236bdd45770ffb41836f75391dc556354bd89 Mon Sep 17 00:00:00 2001 From: Takudzwa-Mlambo <157640942+Cod3Uchiha@users.noreply.github.com> Date: Sun, 8 Feb 2026 14:34:34 -0800 Subject: [PATCH 6/6] fix: switch bot runtime to @whiskeysockets/baileys v7 rc --- all/module.js | 2 +- all/place.js | 2 +- package.json | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/all/module.js b/all/module.js index 29e1c2f..5cea243 100644 --- a/all/module.js +++ b/all/module.js @@ -15,7 +15,7 @@ try { chalk.white = (txt) => txt } -const baileys = require('baileys') +const baileys = require('@whiskeysockets/baileys') const makeWASocket = baileys.default || baileys.makeWASocket || baileys const makeInMemoryStore = typeof baileys.makeInMemoryStore === 'function' ? baileys.makeInMemoryStore diff --git a/all/place.js b/all/place.js index 309a973..fcc11a1 100644 --- a/all/place.js +++ b/all/place.js @@ -2,7 +2,7 @@ const { default: makeWASocket, getContentType, jidDecode, -} = require('baileys') +} = require('@whiskeysockets/baileys') const decodeJid = (jid = '') => { if (!jid) return jid diff --git a/package.json b/package.json index 6d371fb..c68aa25 100644 --- a/package.json +++ b/package.json @@ -30,10 +30,10 @@ "@google/generative-ai": "^0.24.0", "@hapi/boom": "^10.0.0", "@ibaraki-douji/pixivts": "^2.4.1", + "@whiskeysockets/baileys": "^7.0.0-rc.9", "aki-api": "npm:@aqul/akinator-api@1.0.1", "awesome-phonenumber": "^4.4.0", "axios": "^0.24.0", - "baileys": "^6.7.18", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.10", "child_process": "^1.0.2", @@ -41,8 +41,8 @@ "crypto-js": "^4.2.0", "didyoumean": "^1.2.2", "express": "^4.18.2", - "filesize": "^10.0.7", "file-type": "^16.5.3", + "filesize": "^10.0.7", "fluent-ffmpeg": "^2.1.2", "fs": "^0.0.1-security", "g-i-s": "^2.1.7", @@ -54,10 +54,10 @@ "jsdom": "^21.1.0", "lowdb": "^2.1.0", "md5": "^2.3.0", - "mongoose": "^7.3.4", "moment-timezone": "^0.5.43", - "mumaker": "^2.0.0", + "mongoose": "^7.3.4", "ms": "^2.1.3", + "mumaker": "^2.0.0", "node-cache": "^5.1.2", "node-cron": "^3.0.0", "node-fetch": "^2.6.1", @@ -80,8 +80,8 @@ "ws": "^8.13.0", "xmlhttprequest": "^1.8.0", "yargs": "^17.6.2", - "ytdl-core": "npm:@distube/ytdl-core@latest", - "yt-search": "^2.10.4" + "yt-search": "^2.10.4", + "ytdl-core": "npm:@distube/ytdl-core@latest" }, "repository": { "type": "git", @@ -92,6 +92,6 @@ }, "homepage": "https://github.com/Cod3Uchiha/TKM-bot#readme", "overrides": { - "baileys": "^6.7.18" + "@whiskeysockets/baileys": "^7.0.0-rc.9" } }