Jump to content
Bicrypto v4.6.0 + All Plugins
Posted
  • Popular Post
comment_35854

Whatsapp Gateway | Multi Device


This script has been completely modified and many important features and fixes have been added by @Magd Almuntaser
He is now responsible for the updates of this script and has full intellectual property rights
So no one will violate the terms of use that he has set

Latest Features:
1. WhatsApp Account Connectivity

All types of WhatsApp Accounts to be able to connect with WhatsApp Gateway (Multi Number & Multi Device);
Ease of the WhatsApp Account connectivity process with a QRcode Scan or with an Authentication Code directly from your device.

2. Message

Availability of various types of (text messages, media, polls, lists, locations, VCard) can easily be used by you;
You can send mass messages for your marketing campaign activities, promotions or business programs easily and on a scheduled basis;
Setup automatic message replies with more natural (alami) and selected keywords for operational optimization of use;
Manage sent message history with automatic and scheduled deletions.

4. Integration

You can easily integrate your WhatsApp Account with various (AI) artificial intelligence services, namely ChatGPT, DALL-E, Gemini, and Cloude with API authentication codes only;
You can easily activate Ai for Single or Multiple use on your WhatsApp Account;
You can easily select Ai in your WhatsApp messages for WhatsApp Group, Private, or Both types;
You can easily setup call rejection automatically if there is a (Call) call and provide a specific response or information;
Setup your WhatsApp and Ai accounts more naturally (alami) with "Already read" status";
Setup your WhatsApp and Ai accounts more naturally (natural) with the status "Typing...".
You can easily integrate and communicate your services with the Webhook mechanism of WhatsApp Gateway | Multi Device.

5. Application Settings

Nowadays you can easily and quickly carry out the process of setting up the WhatsApp Gateway | Multi Device* application by Magd Almuntaser with the settings panel;
You can easily set up applications based on server ecosystem, smtp, etc quickly;
Multi language support (english, Indonesian, Indian, Spanish and Arabic) for easy use.

6. Developer Options

Currently WhatsApp Gateway | Multi Device* by Magd Almuntaser has provided various API services for your easy development consisting of:
        1). Send Message API
        2). Send Media API
        3). Send Poll API
        4). API Send Button
        5). Send API Templates
        6). Send List message API
        7). Send Location API
        8). Send VCard API
        9). Generate QR API
        10). Disconnect devices
        11). Create User API
        12). User Info API
        13). Device Info API
        14). Check Number API
        15). Webhook Example

Ease of setup and availability of the (API Key) API Key for authentication and authorization of your development process.

7. Security

Currently there is a 2 factor authentication (2FA) service available to maintain the security and comfort of application access;
A password reset service is available if you forget your account login information.


Coming Soon:

1. Landing page for Software as Service services (Subscription Services);
2. Payment gateway page management (QRIS, BCA virtual account, PayPal, Stripe);
3. Added user account management;
4. (ticket) obstacle reporting service for users and managers;
.. And many more.


Whatsapp Gateway | Multi Device

  • Replies 4.4k
  • Views 275.9k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Magd Almuntaser
    Magd Almuntaser

    What's new so far in version 9.0.0: - Added landing page (welcome page). - Added plans system. - Added Manage Languages system. - Added (landing page) edit page. - Added ticket system. - Added cronjob

  • Magd Almuntaser
    Magd Almuntaser

    What's new so far in version 9.0.0: - Added Landing page (Homepage). - Added Plans System. - Added Manage Payment gateways. - Added Manage Languages system. - Added (Homepage) edit page. - Added Ticke

  • Magd Almuntaser
    Magd Almuntaser

    What's new in version 9.0.0 so far: - Added landing page (welcome page). - Added plans system. - Added cronjob page. - Added Multi-Keyword in autoreply. - Added send message with footer. -

Posted Images

Featured Replies

  • Author
comment_71868
16 hours ago, The Billionaire said:

Please who knows a trick I can use to send broadcast messages to 3k numbers without being banned ?????

you can but not 3k numbers .. only 255 every broadcast .. you need to change some files to able to send to brodcast ..
whatsapp gateway script use lib (WhiskeySockets/Baileys) that can login, send msg .. etc
so you can go to here:

github_com/WhiskeySockets/Baileys/pull/249


i've decoded (server/whatsapp.js) file for you so you can change anything you want (Only for v7.0.0):
 

/**************************/
/*    Nulled & Decoded    */
/*   By Magd Almuntaser   */
/*         TTMTT          */
/*         7.0.0          */
/**************************/

const { Boom } = require('@hapi/boom')
const {
  default: makeWASocket,
  Browsers,
  fetchLatestBaileysVersion,
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  DisconnectReason,
} = require('@whiskeysockets/baileys')
const QRCode = require('qrcode'),
  fs = require('fs')
let sock = [],
  qrcode = [],
  pairingCode = [],
  intervalStore = []
const { setStatus } = require('./database/index'),
  { IncomingMessage } = require('./controllers/incomingMessage'),
  {
    formatReceipt,
    getSavedPhoneNumber,
    prepareMediaMessage,
  } = require('./lib/helper'),
  MAIN_LOGGER = require('./lib/pino'),
  NodeCache = require('node-cache'),
  logger = MAIN_LOGGER.child({}),
  msgRetryCounterCache = new NodeCache(),
  connectToWhatsApp = async (
    token,
    ev = null,
    auth = false
  ) => {
    if (typeof qrcode[token] !== 'undefined' && !auth) {
      return (
        ev?.emit('qrcode', {
          token: token,
          data: qrcode[token],
          message: 'please scan with your Whatsapp Accountt',
        }),
        {
          status: false,
          sock: sock[token],
          qrcode: qrcode[token],
          message: 'please scan',
        }
      )
    }
    if (typeof pairingCode[token] !== 'undefined' && auth) {
      return (
        ev?.emit('code', {
          token: token,
          data: pairingCode[token],
          message:
            'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
        }),
        {
          status: false,
          code: pairingCode[token],
          message: 'pairing with that code',
        }
      )
    }
    try {
      let phoneNum = sock[token].user.id.split(':')
      phoneNum = phoneNum[0] + '@s.whatsapp.net'
      const ppUrl = await getPpUrl(token, phoneNum)
      return (
        ev?.emit('connection-open', {
          token: token,
          user: sock[token].user,
          ppUrl: ppUrl,
        }),
        delete qrcode[token],
        delete pairingCode[token],
        {
          status: true,
          message: 'Already connected',
        }
      )
    } catch (error) {
      ev?.emit('message', {
        token: token,
        message: 'Connecting.. (1)..',
      })
    }
    const { version: version, isLatest: isLatest } =
      await fetchLatestBaileysVersion()
    console.log(
      'You re using whatsapp gateway M Pedia v6.1.0 - Contact admin if any trouble : 6292298859671'
    )
    console.log('using WA v' + version.join('.') + ', isLatest: ' + isLatest)
    const { state: state, saveCreds: saveCreds } =
      await useMultiFileAuthState('./credentials/' + token)
    sock[token] = makeWASocket({
      version: version,
      browser: Browsers.macOS('Chrome', 'Mpedia'),
      logger: logger,
      printQRInTerminal: false,
      auth: {
        creds: state.creds,
        keys: makeCacheableSignalKeyStore(state.keys, logger),
      },
      msgRetryCounterCache: msgRetryCounterCache,
      generateHighQualityLinkPreview: true,
    })
    if (auth && 'me' in state.creds === false) {
      const phoneNumber = await getSavedPhoneNumber(token)
      try {
        const code = await sock[token].requestPairingCode(phoneNumber)
        pairingCode[token] = code
      } catch (error) {
        ev?.emit('message', {
          token: token,
          message: 'Time out, please refresh page',
        })
      }
      ev?.emit('code', {
        token: token,
        data: pairingCode[token],
        message:
          'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
      })
    }
    return (
      sock[token].ev.process(async (events) => {
        if (events['connection.update']) {
          const update = events['connection.update'],
            {
              connection: connection,
              lastDisconnect: lastDisconnect,
              qr: qr,
            } = update
          if (connection === 'close') {
            const proto = lastDisconnect.error?.output?.payload?.message,
              msgs = lastDisconnect.error?.output?.payload?.error
            if (
              (lastDisconnect?.error instanceof Boom)?.output?.statusCode !==
              DisconnectReason.loggedOut
            ) {
              delete qrcode[token]
              ev?.emit('message', {
                token: token,
                message: 'Connecting..',
              })
              if (proto == 'QR refs attempts ended') {
                sock[token].ws.close()
                delete qrcode[token]
                delete pairingCode[token]
                delete sock[token]
                ev?.emit('message', {
                  token: token,
                  message: 'Request QR ended. reload web to scan again',
                })
                return
              }
              ;(msgs === 'Unauthorized' ||
                msgs === 'Method Not Allowed') &&
                (setStatus(token, 'Disconnect'),
                clearConnection(token),
                connectToWhatsApp(token, ev))
              proto === 'Stream Errored (restart required)' &&
                connectToWhatsApp(token, ev)
              proto === 'Connection was lost' && delete sock[token]
            } else {
              setStatus(token, 'Disconnect')
              console.log('Connection closed. You are logged out.')
              ev?.emit('message', {
                token: token,
                message: 'Connection closed. You are logged out.',
              })
              clearConnection(token)
              connectToWhatsApp(token, ev)
            }
          }
          qr &&
            (console.log('new qr', token),
            QRCode.toDataURL(qr, function (resMsg, qrCode) {
              if (resMsg) {
                console.log(resMsg)
              }
              qrcode[token] = qrCode
              connectToWhatsApp(token, ev, auth)
            }))
          if (connection === 'open') {
            console.log('OPEN OPEN OPEN')
            setStatus(token, 'Connected')
            delete qrcode[token]
            delete pairingCode[token]
            let PhoneNums = sock[token].user.id.split(':')
            PhoneNums = PhoneNums[0] + '@s.whatsapp.net'
            const ppUrl = await getPpUrl(token, PhoneNums)
            ev?.emit('connection-open', {
              token: token,
              user: sock[token].user,
              ppUrl: ppUrl,
            })
            delete qrcode[token]
            delete pairingCode[token]
          }
        }
        if (events['creds.update']) {
          const updateCreds = events['creds.update']
          saveCreds(updateCreds)
        }
        if (events['messages.upsert']) {
          const msgUpsert = events['messages.upsert']
          IncomingMessage(msgUpsert, sock[token])
        }
      }),
      {
        sock: sock[token],
        qrcode: qrcode[token],
      }
    )
  }
async function connectWaBeforeSend(connTo) {
  let undConn = undefined,	
    connWa
  connWa = await connectToWhatsApp(connTo)
  await connWa.sock.ev.on('connection.update', (qrtoken) => {
    const { connection: connection, qr: qr } = qrtoken
    connection === 'open' && (undConn = true)
    qr && (undConn = false)
  })
  let i = 0
  while (typeof undConn === 'undefined') {
    i++
    if (i > 4) {
      break
    }
    await new Promise((resolve) => setTimeout(resolve, 1000))
  }
  return undConn
}
const sendText = async (token, format, tests) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        { text: tests }
      )
      return conn
    } catch (error) {
      return false
    }
  },
  sendMessage = async (token, format, jsonString) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        JSON.parse(jsonString)
      )
      return conn
    } catch (error) {
      return false
    }
  }
async function sendMedia(
  token,
  format,
  type,
  url,
  caption,
  options,
  fileName
) {
  const id = formatReceipt(format)
  let Jid = sock[token].user.id.replace(/:\d+/, '')
  if (type == 'audio') {
    return await sock[token].sendMessage(id, {
      audio: { url: url },
      ptt: true,
      mimetype: 'audio/mpeg',
    })
  }
  const resPrep = await prepareMediaMessage(sock[token], {
      caption: caption ? caption : '',
      fileName: fileName,
      media: url,
      mediatype:
        type !== 'video' && type !== 'image' ? 'document' : type,
    }),
    message = { ...resPrep.message }
  return await sock[token].sendMessage(id, {
    forward: {
      key: {
        remoteJid: Jid,
        fromMe: true,
      },
      message: message,
    },
  })
}
async function sendButtonMessage(
  token,
  format,
  list,
  caption,
  footer,
  url
) {
  let type = 'url'
  try {
    const buttons = list.map((string, buttonId) => {
      return {
        buttonId: buttonId,
        buttonText: { displayText: string.displayText },
        type: 1,
      }
    })
    if (url) {
      var isimg = {
        image:
          type == 'url'
            ? { url: url }
            : fs.readFileSync('src/public/temp/' + url),
        caption: caption,
        footer: footer,
        buttons: buttons,
        headerType: 4,
        viewOnce: true,
      }
    } else {
      var isimg = {
        text: caption,
        footer: footer,
        buttons: buttons,
        headerType: 1,
        viewOnce: true,
      }
    }
    const sendMs = await sock[token].sendMessage(
      formatReceipt(format),
      isimg
    )
    return sendMs
  } catch (error) {
    return console.log(error), false
  }
}
async function sendTemplateMessage(
  token,
  format,
  templateButtons,
  caption,
  footer,
  url
) {
  try {
    if (url) {
      var types = {
        caption: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
        image: { url: url },
        viewOnce: true,
      }
    } else {
      var types = {
        text: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
      }
    }
    const resSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      types
    )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendListMessage(
  token,
  format,
  sections,
  texts,
  footer,
  title,
  buttonText
) {
  try {
    const Lists = {
        text: texts,
        footer: footer,
        title: title,
        buttonText: buttonText,
        sections: [sections],
      },
      resSendMsg = await sock[token].sendMessage(
        formatReceipt(format),
        Lists,
        { ephemeralExpiration: 604800 }
      )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendPollMessage(
  token,
  format,
  name,
  values,
  selectableCount
) {
  try {
    const ResSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      {
        poll: {
          name: name,
          values: values,
          selectableCount: selectableCount,
        },
      }
    )
    return ResSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function fetchGroups(token) {
  try {
    let GetAll = await sock[token].groupFetchAllParticipating(),
      ResGet = Object.entries(GetAll)
        .slice(0)
        .map((MapGroup) => MapGroup[1])
    return ResGet
  } catch (error) {
    return false
  }
}
async function isExist(token, PhoneNum) {
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnBe = await connectWaBeforeSend(token)
      if (!ConnBe) {
        return false
      }
    }
    if (PhoneNum.includes('@g.us')) {
      return true
    } else {
      const [isNum] = await sock[token].onWhatsApp('+' + PhoneNum)
      return PhoneNum.length > 11 ? isNum : true
    }
  } catch (error) {
    return false
  }
}
async function getPpUrl(token, string, type) {
  let imgPp
  try {
    return (
      (imgPp = await sock[token].profilePictureUrl(string)),
      imgPp
    )
  } catch (error) {
    return 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/1200px-WhatsApp.svg.png'
  }
}
async function deleteCredentials(token, evs = null) {
  evs !== null &&
    evs.emit('message', {
      token: token,
      message: 'Logout Progres..',
    })
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnWaBe = await connectWaBeforeSend(token)
      ConnWaBe && (sock[token].logout(), delete sock[token])
    } else {
      sock[token].logout()
      delete sock[token]
    }
    return (
      delete qrcode[token],
      clearInterval(intervalStore[token]),
      setStatus(token, 'Disconnect'),
      evs != null &&
        (evs.emit('Unauthorized', token),
        evs.emit('message', {
          token: token,
          message: 'Connection closed. You are logged out.',
        })),
      fs.existsSync('./credentials/' + token) &&
        fs.rmSync(
          './credentials/' + token,
          {
            recursive: true,
            force: true,
          },
          (debug) => {
            if (debug) {
              console.log(debug)
            }
          }
        ),
      {
        status: true,
        message: 'Deleting session and credential',
      }
    )
  } catch (error) {
    return (
      console.log(error),
      {
        status: true,
        message: 'Nothing deleted',
      }
    )
  }
}
function clearConnection(token) {
  clearInterval(intervalStore[token])
  delete sock[token]
  delete qrcode[token]
  setStatus(token, 'Disconnect')
  fs.existsSync('./credentials/' + token) &&
    (fs.rmSync(
      './credentials/' + token,
      {
        recursive: true,
        force: true,
      },
      (debug) => {
        if (debug) {
          console.log(debug)
        }
      }
    ),
    console.log('credentials/' + token + ' is deleted'))
}
async function initialize(filetoken, result) {
  const { token: token } = filetoken.body
  if (token) {
    const readFileSync = require('fs'),
      path = './credentials/' + token
    if (readFileSync.existsSync(path)) {
      sock[token] = undefined
      const resultBefore = await connectWaBeforeSend(token)
      return resultBefore
        ? result.status(200).json({
            status: true,
            message: token + ' connection restored',
          })
        : result.status(200).json({
            status: false,
            message: token + ' connection failed',
          })
    }
    return result.send({
      status: false,
      message: token + ' Connection failed,please scan first',
    })
  }
  return result.send({
    status: false,
    message: 'Wrong Parameterss',
  })
}
module.exports = {
  connectToWhatsApp: connectToWhatsApp,
  sendText: sendText,
  sendMedia: sendMedia,
  sendButtonMessage: sendButtonMessage,
  sendTemplateMessage: sendTemplateMessage,
  sendListMessage: sendListMessage,
  sendPollMessage: sendPollMessage,
  isExist: isExist,
  getPpUrl: getPpUrl,
  fetchGroups: fetchGroups,
  deleteCredentials: deleteCredentials,
  sendMessage: sendMessage,
  initialize: initialize,
  connectWaBeforeSend: connectWaBeforeSend,
  sock: sock,
}

 

whatsapp.js

Edited by Magd Almuntaser

comment_71875
6 hours ago, Magd Almuntaser said:

you can but not 3k numbers .. only 255 every broadcast .. you need to change some files to able to send to brodcast ..
whatsapp gateway script use lib (WhiskeySockets/Baileys) that can login, send msg .. etc
so you can go to here:

github_com/WhiskeySockets/Baileys/pull/249


i've decoded (server/whatsapp.js) file for you so you can change anything you want:
 

/**************************/
/*    Nulled & Decoded    */
/*   By Magd Almuntaser   */
/*         TTMTT          */
/**************************/

const { Boom } = require('@hapi/boom')
const {
  default: makeWASocket,
  Browsers,
  fetchLatestBaileysVersion,
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  DisconnectReason,
} = require('@whiskeysockets/baileys')
const QRCode = require('qrcode'),
  fs = require('fs')
let sock = [],
  qrcode = [],
  pairingCode = [],
  intervalStore = []
const { setStatus } = require('./database/index'),
  { IncomingMessage } = require('./controllers/incomingMessage'),
  {
    formatReceipt,
    getSavedPhoneNumber,
    prepareMediaMessage,
  } = require('./lib/helper'),
  MAIN_LOGGER = require('./lib/pino'),
  NodeCache = require('node-cache'),
  logger = MAIN_LOGGER.child({}),
  msgRetryCounterCache = new NodeCache(),
  connectToWhatsApp = async (
    token,
    ev = null,
    auth = false
  ) => {
    if (typeof qrcode[token] !== 'undefined' && !auth) {
      return (
        ev?.emit('qrcode', {
          token: token,
          data: qrcode[token],
          message: 'please scan with your Whatsapp Accountt',
        }),
        {
          status: false,
          sock: sock[token],
          qrcode: qrcode[token],
          message: 'please scan',
        }
      )
    }
    if (typeof pairingCode[token] !== 'undefined' && auth) {
      return (
        ev?.emit('code', {
          token: token,
          data: pairingCode[token],
          message:
            'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
        }),
        {
          status: false,
          code: pairingCode[token],
          message: 'pairing with that code',
        }
      )
    }
    try {
      let phoneNum = sock[token].user.id.split(':')
      phoneNum = phoneNum[0] + '@s.whatsapp.net'
      const ppUrl = await getPpUrl(token, phoneNum)
      return (
        ev?.emit('connection-open', {
          token: token,
          user: sock[token].user,
          ppUrl: ppUrl,
        }),
        delete qrcode[token],
        delete pairingCode[token],
        {
          status: true,
          message: 'Already connected',
        }
      )
    } catch (error) {
      ev?.emit('message', {
        token: token,
        message: 'Connecting.. (1)..',
      })
    }
    const { version: version, isLatest: isLatest } =
      await fetchLatestBaileysVersion()
    console.log(
      'You re using whatsapp gateway M Pedia v6.1.0 - Contact admin if any trouble : 6292298859671'
    )
    console.log('using WA v' + version.join('.') + ', isLatest: ' + isLatest)
    const { state: state, saveCreds: saveCreds } =
      await useMultiFileAuthState('./credentials/' + token)
    sock[token] = makeWASocket({
      version: version,
      browser: Browsers.macOS('Chrome', 'Mpedia'),
      logger: logger,
      printQRInTerminal: false,
      auth: {
        creds: state.creds,
        keys: makeCacheableSignalKeyStore(state.keys, logger),
      },
      msgRetryCounterCache: msgRetryCounterCache,
      generateHighQualityLinkPreview: true,
    })
    if (auth && 'me' in state.creds === false) {
      const phoneNumber = await getSavedPhoneNumber(token)
      try {
        const code = await sock[token].requestPairingCode(phoneNumber)
        pairingCode[token] = code
      } catch (error) {
        ev?.emit('message', {
          token: token,
          message: 'Time out, please refresh page',
        })
      }
      ev?.emit('code', {
        token: token,
        data: pairingCode[token],
        message:
          'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
      })
    }
    return (
      sock[token].ev.process(async (events) => {
        if (events['connection.update']) {
          const update = events['connection.update'],
            {
              connection: connection,
              lastDisconnect: lastDisconnect,
              qr: qr,
            } = update
          if (connection === 'close') {
            const proto = lastDisconnect.error?.output?.payload?.message,
              msgs = lastDisconnect.error?.output?.payload?.error
            if (
              (lastDisconnect?.error instanceof Boom)?.output?.statusCode !==
              DisconnectReason.loggedOut
            ) {
              delete qrcode[token]
              ev?.emit('message', {
                token: token,
                message: 'Connecting..',
              })
              if (proto == 'QR refs attempts ended') {
                sock[token].ws.close()
                delete qrcode[token]
                delete pairingCode[token]
                delete sock[token]
                ev?.emit('message', {
                  token: token,
                  message: 'Request QR ended. reload web to scan again',
                })
                return
              }
              ;(msgs === 'Unauthorized' ||
                msgs === 'Method Not Allowed') &&
                (setStatus(token, 'Disconnect'),
                clearConnection(token),
                connectToWhatsApp(token, ev))
              proto === 'Stream Errored (restart required)' &&
                connectToWhatsApp(token, ev)
              proto === 'Connection was lost' && delete sock[token]
            } else {
              setStatus(token, 'Disconnect')
              console.log('Connection closed. You are logged out.')
              ev?.emit('message', {
                token: token,
                message: 'Connection closed. You are logged out.',
              })
              clearConnection(token)
              connectToWhatsApp(token, ev)
            }
          }
          qr &&
            (console.log('new qr', token),
            QRCode.toDataURL(qr, function (resMsg, qrCode) {
              if (resMsg) {
                console.log(resMsg)
              }
              qrcode[token] = qrCode
              connectToWhatsApp(token, ev, auth)
            }))
          if (connection === 'open') {
            console.log('OPEN OPEN OPEN')
            setStatus(token, 'Connected')
            delete qrcode[token]
            delete pairingCode[token]
            let PhoneNums = sock[token].user.id.split(':')
            PhoneNums = PhoneNums[0] + '@s.whatsapp.net'
            const ppUrl = await getPpUrl(token, PhoneNums)
            ev?.emit('connection-open', {
              token: token,
              user: sock[token].user,
              ppUrl: ppUrl,
            })
            delete qrcode[token]
            delete pairingCode[token]
          }
        }
        if (events['creds.update']) {
          const updateCreds = events['creds.update']
          saveCreds(updateCreds)
        }
        if (events['messages.upsert']) {
          const msgUpsert = events['messages.upsert']
          IncomingMessage(msgUpsert, sock[token])
        }
      }),
      {
        sock: sock[token],
        qrcode: qrcode[token],
      }
    )
  }
async function connectWaBeforeSend(connTo) {
  let undConn = undefined,	
    connWa
  connWa = await connectToWhatsApp(connTo)
  await connWa.sock.ev.on('connection.update', (qrtoken) => {
    const { connection: connection, qr: qr } = qrtoken
    connection === 'open' && (undConn = true)
    qr && (undConn = false)
  })
  let i = 0
  while (typeof undConn === 'undefined') {
    i++
    if (i > 4) {
      break
    }
    await new Promise((resolve) => setTimeout(resolve, 1000))
  }
  return undConn
}
const sendText = async (token, format, tests) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        { text: tests }
      )
      return conn
    } catch (error) {
      return false
    }
  },
  sendMessage = async (token, format, jsonString) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        JSON.parse(jsonString)
      )
      return conn
    } catch (error) {
      return false
    }
  }
async function sendMedia(
  token,
  format,
  type,
  url,
  caption,
  options,
  fileName
) {
  const id = formatReceipt(format)
  let Jid = sock[token].user.id.replace(/:\d+/, '')
  if (type == 'audio') {
    return await sock[token].sendMessage(id, {
      audio: { url: url },
      ptt: true,
      mimetype: 'audio/mpeg',
    })
  }
  const resPrep = await prepareMediaMessage(sock[token], {
      caption: caption ? caption : '',
      fileName: fileName,
      media: url,
      mediatype:
        type !== 'video' && type !== 'image' ? 'document' : type,
    }),
    message = { ...resPrep.message }
  return await sock[token].sendMessage(id, {
    forward: {
      key: {
        remoteJid: Jid,
        fromMe: true,
      },
      message: message,
    },
  })
}
async function sendButtonMessage(
  token,
  format,
  list,
  caption,
  footer,
  url
) {
  let type = 'url'
  try {
    const buttons = list.map((string, buttonId) => {
      return {
        buttonId: buttonId,
        buttonText: { displayText: string.displayText },
        type: 1,
      }
    })
    if (url) {
      var isimg = {
        image:
          type == 'url'
            ? { url: url }
            : fs.readFileSync('src/public/temp/' + url),
        caption: caption,
        footer: footer,
        buttons: buttons,
        headerType: 4,
        viewOnce: true,
      }
    } else {
      var isimg = {
        text: caption,
        footer: footer,
        buttons: buttons,
        headerType: 1,
        viewOnce: true,
      }
    }
    const sendMs = await sock[token].sendMessage(
      formatReceipt(format),
      isimg
    )
    return sendMs
  } catch (error) {
    return console.log(error), false
  }
}
async function sendTemplateMessage(
  token,
  format,
  templateButtons,
  caption,
  footer,
  url
) {
  try {
    if (url) {
      var types = {
        caption: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
        image: { url: url },
        viewOnce: true,
      }
    } else {
      var types = {
        text: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
      }
    }
    const resSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      types
    )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendListMessage(
  token,
  format,
  sections,
  texts,
  footer,
  title,
  buttonText
) {
  try {
    const Lists = {
        text: texts,
        footer: footer,
        title: title,
        buttonText: buttonText,
        sections: [sections],
      },
      resSendMsg = await sock[token].sendMessage(
        formatReceipt(format),
        Lists,
        { ephemeralExpiration: 604800 }
      )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendPollMessage(
  token,
  format,
  name,
  values,
  selectableCount
) {
  try {
    const ResSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      {
        poll: {
          name: name,
          values: values,
          selectableCount: selectableCount,
        },
      }
    )
    return ResSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function fetchGroups(token) {
  try {
    let GetAll = await sock[token].groupFetchAllParticipating(),
      ResGet = Object.entries(GetAll)
        .slice(0)
        .map((MapGroup) => MapGroup[1])
    return ResGet
  } catch (error) {
    return false
  }
}
async function isExist(token, PhoneNum) {
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnBe = await connectWaBeforeSend(token)
      if (!ConnBe) {
        return false
      }
    }
    if (PhoneNum.includes('@g.us')) {
      return true
    } else {
      const [isNum] = await sock[token].onWhatsApp('+' + PhoneNum)
      return PhoneNum.length > 11 ? isNum : true
    }
  } catch (error) {
    return false
  }
}
async function getPpUrl(token, string, type) {
  let imgPp
  try {
    return (
      (imgPp = await sock[token].profilePictureUrl(string)),
      imgPp
    )
  } catch (error) {
    return 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/1200px-WhatsApp.svg.png'
  }
}
async function deleteCredentials(token, evs = null) {
  evs !== null &&
    evs.emit('message', {
      token: token,
      message: 'Logout Progres..',
    })
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnWaBe = await connectWaBeforeSend(token)
      ConnWaBe && (sock[token].logout(), delete sock[token])
    } else {
      sock[token].logout()
      delete sock[token]
    }
    return (
      delete qrcode[token],
      clearInterval(intervalStore[token]),
      setStatus(token, 'Disconnect'),
      evs != null &&
        (evs.emit('Unauthorized', token),
        evs.emit('message', {
          token: token,
          message: 'Connection closed. You are logged out.',
        })),
      fs.existsSync('./credentials/' + token) &&
        fs.rmSync(
          './credentials/' + token,
          {
            recursive: true,
            force: true,
          },
          (debug) => {
            if (debug) {
              console.log(debug)
            }
          }
        ),
      {
        status: true,
        message: 'Deleting session and credential',
      }
    )
  } catch (error) {
    return (
      console.log(error),
      {
        status: true,
        message: 'Nothing deleted',
      }
    )
  }
}
function clearConnection(token) {
  clearInterval(intervalStore[token])
  delete sock[token]
  delete qrcode[token]
  setStatus(token, 'Disconnect')
  fs.existsSync('./credentials/' + token) &&
    (fs.rmSync(
      './credentials/' + token,
      {
        recursive: true,
        force: true,
      },
      (debug) => {
        if (debug) {
          console.log(debug)
        }
      }
    ),
    console.log('credentials/' + token + ' is deleted'))
}
async function initialize(filetoken, result) {
  const { token: token } = filetoken.body
  if (token) {
    const readFileSync = require('fs'),
      path = './credentials/' + token
    if (readFileSync.existsSync(path)) {
      sock[token] = undefined
      const resultBefore = await connectWaBeforeSend(token)
      return resultBefore
        ? result.status(200).json({
            status: true,
            message: token + ' connection restored',
          })
        : result.status(200).json({
            status: false,
            message: token + ' connection failed',
          })
    }
    return result.send({
      status: false,
      message: token + ' Connection failed,please scan first',
    })
  }
  return result.send({
    status: false,
    message: 'Wrong Parameterss',
  })
}
module.exports = {
  connectToWhatsApp: connectToWhatsApp,
  sendText: sendText,
  sendMedia: sendMedia,
  sendButtonMessage: sendButtonMessage,
  sendTemplateMessage: sendTemplateMessage,
  sendListMessage: sendListMessage,
  sendPollMessage: sendPollMessage,
  isExist: isExist,
  getPpUrl: getPpUrl,
  fetchGroups: fetchGroups,
  deleteCredentials: deleteCredentials,
  sendMessage: sendMessage,
  initialize: initialize,
  connectWaBeforeSend: connectWaBeforeSend,
  sock: sock,
}

 

whatsapp.js 15.54 kB · 3 downloads

ini di replace di whatsapp.js yang ada di folder server ya?

comment_71882
11 hours ago, Magd Almuntaser said:

you can but not 3k numbers .. only 255 every broadcast .. you need to change some files to able to send to brodcast ..
whatsapp gateway script use lib (WhiskeySockets/Baileys) that can login, send msg .. etc
so you can go to here:

github_com/WhiskeySockets/Baileys/pull/249
 


i've decoded (server/whatsapp.js) file for you so you can change anything you want:
 

/**************************/
/*    Nulled & Decoded    */
/*   By Magd Almuntaser   */
/*         TTMTT          */
/**************************/

const { Boom } = require('@hapi/boom')
const {
  default: makeWASocket,
  Browsers,
  fetchLatestBaileysVersion,
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  DisconnectReason,
} = require('@whiskeysockets/baileys')
const QRCode = require('qrcode'),
  fs = require('fs')
let sock = [],
  qrcode = [],
  pairingCode = [],
  intervalStore = []
const { setStatus } = require('./database/index'),
  { IncomingMessage } = require('./controllers/incomingMessage'),
  {
    formatReceipt,
    getSavedPhoneNumber,
    prepareMediaMessage,
  } = require('./lib/helper'),
  MAIN_LOGGER = require('./lib/pino'),
  NodeCache = require('node-cache'),
  logger = MAIN_LOGGER.child({}),
  msgRetryCounterCache = new NodeCache(),
  connectToWhatsApp = async (
    token,
    ev = null,
    auth = false
  ) => {
    if (typeof qrcode[token] !== 'undefined' && !auth) {
      return (
        ev?.emit('qrcode', {
          token: token,
          data: qrcode[token],
          message: 'please scan with your Whatsapp Accountt',
        }),
        {
          status: false,
          sock: sock[token],
          qrcode: qrcode[token],
          message: 'please scan',
        }
      )
    }
    if (typeof pairingCode[token] !== 'undefined' && auth) {
      return (
        ev?.emit('code', {
          token: token,
          data: pairingCode[token],
          message:
            'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
        }),
        {
          status: false,
          code: pairingCode[token],
          message: 'pairing with that code',
        }
      )
    }
    try {
      let phoneNum = sock[token].user.id.split(':')
      phoneNum = phoneNum[0] + '@s.whatsapp.net'
      const ppUrl = await getPpUrl(token, phoneNum)
      return (
        ev?.emit('connection-open', {
          token: token,
          user: sock[token].user,
          ppUrl: ppUrl,
        }),
        delete qrcode[token],
        delete pairingCode[token],
        {
          status: true,
          message: 'Already connected',
        }
      )
    } catch (error) {
      ev?.emit('message', {
        token: token,
        message: 'Connecting.. (1)..',
      })
    }
    const { version: version, isLatest: isLatest } =
      await fetchLatestBaileysVersion()
    console.log(
      'You re using whatsapp gateway M Pedia v6.1.0 - Contact admin if any trouble : 6292298859671'
    )
    console.log('using WA v' + version.join('.') + ', isLatest: ' + isLatest)
    const { state: state, saveCreds: saveCreds } =
      await useMultiFileAuthState('./credentials/' + token)
    sock[token] = makeWASocket({
      version: version,
      browser: Browsers.macOS('Chrome', 'Mpedia'),
      logger: logger,
      printQRInTerminal: false,
      auth: {
        creds: state.creds,
        keys: makeCacheableSignalKeyStore(state.keys, logger),
      },
      msgRetryCounterCache: msgRetryCounterCache,
      generateHighQualityLinkPreview: true,
    })
    if (auth && 'me' in state.creds === false) {
      const phoneNumber = await getSavedPhoneNumber(token)
      try {
        const code = await sock[token].requestPairingCode(phoneNumber)
        pairingCode[token] = code
      } catch (error) {
        ev?.emit('message', {
          token: token,
          message: 'Time out, please refresh page',
        })
      }
      ev?.emit('code', {
        token: token,
        data: pairingCode[token],
        message:
          'Go to whatsapp -> link device -> link with phone number, and pairing with this code.',
      })
    }
    return (
      sock[token].ev.process(async (events) => {
        if (events['connection.update']) {
          const update = events['connection.update'],
            {
              connection: connection,
              lastDisconnect: lastDisconnect,
              qr: qr,
            } = update
          if (connection === 'close') {
            const proto = lastDisconnect.error?.output?.payload?.message,
              msgs = lastDisconnect.error?.output?.payload?.error
            if (
              (lastDisconnect?.error instanceof Boom)?.output?.statusCode !==
              DisconnectReason.loggedOut
            ) {
              delete qrcode[token]
              ev?.emit('message', {
                token: token,
                message: 'Connecting..',
              })
              if (proto == 'QR refs attempts ended') {
                sock[token].ws.close()
                delete qrcode[token]
                delete pairingCode[token]
                delete sock[token]
                ev?.emit('message', {
                  token: token,
                  message: 'Request QR ended. reload web to scan again',
                })
                return
              }
              ;(msgs === 'Unauthorized' ||
                msgs === 'Method Not Allowed') &&
                (setStatus(token, 'Disconnect'),
                clearConnection(token),
                connectToWhatsApp(token, ev))
              proto === 'Stream Errored (restart required)' &&
                connectToWhatsApp(token, ev)
              proto === 'Connection was lost' && delete sock[token]
            } else {
              setStatus(token, 'Disconnect')
              console.log('Connection closed. You are logged out.')
              ev?.emit('message', {
                token: token,
                message: 'Connection closed. You are logged out.',
              })
              clearConnection(token)
              connectToWhatsApp(token, ev)
            }
          }
          qr &&
            (console.log('new qr', token),
            QRCode.toDataURL(qr, function (resMsg, qrCode) {
              if (resMsg) {
                console.log(resMsg)
              }
              qrcode[token] = qrCode
              connectToWhatsApp(token, ev, auth)
            }))
          if (connection === 'open') {
            console.log('OPEN OPEN OPEN')
            setStatus(token, 'Connected')
            delete qrcode[token]
            delete pairingCode[token]
            let PhoneNums = sock[token].user.id.split(':')
            PhoneNums = PhoneNums[0] + '@s.whatsapp.net'
            const ppUrl = await getPpUrl(token, PhoneNums)
            ev?.emit('connection-open', {
              token: token,
              user: sock[token].user,
              ppUrl: ppUrl,
            })
            delete qrcode[token]
            delete pairingCode[token]
          }
        }
        if (events['creds.update']) {
          const updateCreds = events['creds.update']
          saveCreds(updateCreds)
        }
        if (events['messages.upsert']) {
          const msgUpsert = events['messages.upsert']
          IncomingMessage(msgUpsert, sock[token])
        }
      }),
      {
        sock: sock[token],
        qrcode: qrcode[token],
      }
    )
  }
async function connectWaBeforeSend(connTo) {
  let undConn = undefined,	
    connWa
  connWa = await connectToWhatsApp(connTo)
  await connWa.sock.ev.on('connection.update', (qrtoken) => {
    const { connection: connection, qr: qr } = qrtoken
    connection === 'open' && (undConn = true)
    qr && (undConn = false)
  })
  let i = 0
  while (typeof undConn === 'undefined') {
    i++
    if (i > 4) {
      break
    }
    await new Promise((resolve) => setTimeout(resolve, 1000))
  }
  return undConn
}
const sendText = async (token, format, tests) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        { text: tests }
      )
      return conn
    } catch (error) {
      return false
    }
  },
  sendMessage = async (token, format, jsonString) => {
    try {
      const conn = await sock[token].sendMessage(
        formatReceipt(format),
        JSON.parse(jsonString)
      )
      return conn
    } catch (error) {
      return false
    }
  }
async function sendMedia(
  token,
  format,
  type,
  url,
  caption,
  options,
  fileName
) {
  const id = formatReceipt(format)
  let Jid = sock[token].user.id.replace(/:\d+/, '')
  if (type == 'audio') {
    return await sock[token].sendMessage(id, {
      audio: { url: url },
      ptt: true,
      mimetype: 'audio/mpeg',
    })
  }
  const resPrep = await prepareMediaMessage(sock[token], {
      caption: caption ? caption : '',
      fileName: fileName,
      media: url,
      mediatype:
        type !== 'video' && type !== 'image' ? 'document' : type,
    }),
    message = { ...resPrep.message }
  return await sock[token].sendMessage(id, {
    forward: {
      key: {
        remoteJid: Jid,
        fromMe: true,
      },
      message: message,
    },
  })
}
async function sendButtonMessage(
  token,
  format,
  list,
  caption,
  footer,
  url
) {
  let type = 'url'
  try {
    const buttons = list.map((string, buttonId) => {
      return {
        buttonId: buttonId,
        buttonText: { displayText: string.displayText },
        type: 1,
      }
    })
    if (url) {
      var isimg = {
        image:
          type == 'url'
            ? { url: url }
            : fs.readFileSync('src/public/temp/' + url),
        caption: caption,
        footer: footer,
        buttons: buttons,
        headerType: 4,
        viewOnce: true,
      }
    } else {
      var isimg = {
        text: caption,
        footer: footer,
        buttons: buttons,
        headerType: 1,
        viewOnce: true,
      }
    }
    const sendMs = await sock[token].sendMessage(
      formatReceipt(format),
      isimg
    )
    return sendMs
  } catch (error) {
    return console.log(error), false
  }
}
async function sendTemplateMessage(
  token,
  format,
  templateButtons,
  caption,
  footer,
  url
) {
  try {
    if (url) {
      var types = {
        caption: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
        image: { url: url },
        viewOnce: true,
      }
    } else {
      var types = {
        text: caption,
        footer: footer,
        viewOnce: true,
        templateButtons: templateButtons,
      }
    }
    const resSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      types
    )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendListMessage(
  token,
  format,
  sections,
  texts,
  footer,
  title,
  buttonText
) {
  try {
    const Lists = {
        text: texts,
        footer: footer,
        title: title,
        buttonText: buttonText,
        sections: [sections],
      },
      resSendMsg = await sock[token].sendMessage(
        formatReceipt(format),
        Lists,
        { ephemeralExpiration: 604800 }
      )
    return resSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function sendPollMessage(
  token,
  format,
  name,
  values,
  selectableCount
) {
  try {
    const ResSendMsg = await sock[token].sendMessage(
      formatReceipt(format),
      {
        poll: {
          name: name,
          values: values,
          selectableCount: selectableCount,
        },
      }
    )
    return ResSendMsg
  } catch (error) {
    return console.log(error), false
  }
}
async function fetchGroups(token) {
  try {
    let GetAll = await sock[token].groupFetchAllParticipating(),
      ResGet = Object.entries(GetAll)
        .slice(0)
        .map((MapGroup) => MapGroup[1])
    return ResGet
  } catch (error) {
    return false
  }
}
async function isExist(token, PhoneNum) {
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnBe = await connectWaBeforeSend(token)
      if (!ConnBe) {
        return false
      }
    }
    if (PhoneNum.includes('@g.us')) {
      return true
    } else {
      const [isNum] = await sock[token].onWhatsApp('+' + PhoneNum)
      return PhoneNum.length > 11 ? isNum : true
    }
  } catch (error) {
    return false
  }
}
async function getPpUrl(token, string, type) {
  let imgPp
  try {
    return (
      (imgPp = await sock[token].profilePictureUrl(string)),
      imgPp
    )
  } catch (error) {
    return 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/1200px-WhatsApp.svg.png'
  }
}
async function deleteCredentials(token, evs = null) {
  evs !== null &&
    evs.emit('message', {
      token: token,
      message: 'Logout Progres..',
    })
  try {
    if (typeof sock[token] === 'undefined') {
      const ConnWaBe = await connectWaBeforeSend(token)
      ConnWaBe && (sock[token].logout(), delete sock[token])
    } else {
      sock[token].logout()
      delete sock[token]
    }
    return (
      delete qrcode[token],
      clearInterval(intervalStore[token]),
      setStatus(token, 'Disconnect'),
      evs != null &&
        (evs.emit('Unauthorized', token),
        evs.emit('message', {
          token: token,
          message: 'Connection closed. You are logged out.',
        })),
      fs.existsSync('./credentials/' + token) &&
        fs.rmSync(
          './credentials/' + token,
          {
            recursive: true,
            force: true,
          },
          (debug) => {
            if (debug) {
              console.log(debug)
            }
          }
        ),
      {
        status: true,
        message: 'Deleting session and credential',
      }
    )
  } catch (error) {
    return (
      console.log(error),
      {
        status: true,
        message: 'Nothing deleted',
      }
    )
  }
}
function clearConnection(token) {
  clearInterval(intervalStore[token])
  delete sock[token]
  delete qrcode[token]
  setStatus(token, 'Disconnect')
  fs.existsSync('./credentials/' + token) &&
    (fs.rmSync(
      './credentials/' + token,
      {
        recursive: true,
        force: true,
      },
      (debug) => {
        if (debug) {
          console.log(debug)
        }
      }
    ),
    console.log('credentials/' + token + ' is deleted'))
}
async function initialize(filetoken, result) {
  const { token: token } = filetoken.body
  if (token) {
    const readFileSync = require('fs'),
      path = './credentials/' + token
    if (readFileSync.existsSync(path)) {
      sock[token] = undefined
      const resultBefore = await connectWaBeforeSend(token)
      return resultBefore
        ? result.status(200).json({
            status: true,
            message: token + ' connection restored',
          })
        : result.status(200).json({
            status: false,
            message: token + ' connection failed',
          })
    }
    return result.send({
      status: false,
      message: token + ' Connection failed,please scan first',
    })
  }
  return result.send({
    status: false,
    message: 'Wrong Parameterss',
  })
}
module.exports = {
  connectToWhatsApp: connectToWhatsApp,
  sendText: sendText,
  sendMedia: sendMedia,
  sendButtonMessage: sendButtonMessage,
  sendTemplateMessage: sendTemplateMessage,
  sendListMessage: sendListMessage,
  sendPollMessage: sendPollMessage,
  isExist: isExist,
  getPpUrl: getPpUrl,
  fetchGroups: fetchGroups,
  deleteCredentials: deleteCredentials,
  sendMessage: sendMessage,
  initialize: initialize,
  connectWaBeforeSend: connectWaBeforeSend,
  sock: sock,
}
 

 

whatsapp.js 15.54 kB · 5 downloads

@Magd Almuntaser I have copied the code and replaced it inside the server/whatsapp.js so what else can I do now ???

  • Author
comment_71886
5 hours ago, pak kacung said:

ini di replace di whatsapp.js yang ada di folder server ya?

Ya ..

39 minutes ago, The Billionaire said:

@Magd Almuntaser I have copied the code and replaced it inside the server/whatsapp.js so what else can I do now ???

I just decode the file ..

But i mean try to get the ID for boradcast so you can send msg to (id@broadcast) becouse WA7 don't have fetch broadcast id so you can change some function to get the broadcast id

id=msg_timestamp ..

So you need first get the id after that you can send normaly

Edited by Magd Almuntaser

comment_71887
4 minutes ago, Magd Almuntaser said:

Ya ..

I just decode the file ..

But i mean try to get the ID for boradcast so you can send msg to (id@broadcast) becouse WA7 don't have fetch broadcast id so you can change some function to get the broadcast id

id=msg_timestamp ..

So you need first get the id after that you can send normaly

Bro decode file js nya, semua file js di encrypt

comment_71888
54 minutes ago, Magd Almuntaser said:

Ya ..

I just decode the file ..

But i mean try to get the ID for boradcast so you can send msg to (id@broadcast) becouse WA7 don't have fetch broadcast id so you can change some function to get the broadcast id

id=msg_timestamp ..

So you need first get the id after that you can send normaly

@Magd Almuntaser let me explain my issues hope you will understand, the broadcast is working, just that after it has been sent to 20 numbers from the 3k numbers WhatsApp blocked my line for spamming, although they have released my account, I want a way to prevent it from happening again when I resume the broadcast

  • Author
comment_71889
4 minutes ago, The Billionaire said:

@Magd Almuntaser let me explain my issues hope you will understand, the broadcast is working, just that after it has been sent to 20 numbers from the 3k numbers WhatsApp blocked my line for spamming, although they have released my account, I want a way to prevent it from happening again when I resume the broadcast

If you send a broadcast, you won't be blocked. That's what surprised me.
Are you sure you used (status@broadcast) when you sent it?
Or did you just loop the numbers and send?

comment_71895
2 hours ago, Magd Almuntaser said:

I have Decoded the JS files.
You can download them from the attachments
Extract the compressed file to the script path

 

Decoded_JS_File.zip 13.04 kB · 2 downloads

@Magd Almuntaser I am sorry I made a mistake is the Campaign not a Broadcast message, so when I send Campaign to a 3k number I get banned, is there a way to scale through it

  • Author
comment_71908
5 hours ago, The Billionaire said:

@Magd Almuntaser I am sorry I made a mistake is the Campaign not a Broadcast message, so when I send Campaign to a 3k number I get banned, is there a way to scale through it

I think campaign use loop numbers that mean send every number alone so you will get block ..

But maybe you can use (sleep) function every 15 numbers ..

Or use broadcast ..

comment_71947
On 7/1/2024 at 9:19 AM, The Billionaire said:

@Magd Almuntaser I am sorry I made a mistake is the Campaign not a Broadcast message, so when I send Campaign to a 3k number I get banned, is there a way to scale through it

@The Billionaire What I do is in the campaign option that says delivery time between each message, I put it as a minimum of 10 to 15 seconds to try to prevent WhatsApp from taking it as spam, remember that there is also the possibility that if users They report that it happens faster

comment_72008

@Magd Almuntaser

On 7/1/2024 at 6:12 PM, Magd Almuntaser said:

I have Decoded the JS files.
You can download them from the attachments
Extract the compressed file to the script path
Only For Version v7.0.0

 

Decoded_JS_File.zip 13.04 kB · 24 downloads

help please, on campaign and autoreply not work


ReferenceError: Cannot access 'inProgress' before initialization
    at sendBlastMessage (/home/waswupn/subdomain/waswupn.com/server/controllers/blast.js:40:3)
    at Layer.handle [as handle_request] (/home/waswupn/nodevenv/subdomain/waswupn.com/16/lib/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/waswupn/nodevenv/subdomain/waswupn.com/16/lib/node_modules/express/lib/router/route.js:149:13)
    at checkConnectionBeforeBlast (/home/waswupn/subdomain/waswupn.com/server/lib/middleware.js:34:5)

Edited by Putra Pertama

  • Author
comment_72015
7 hours ago, pak kacung said:

@Gusik Prasetyo saya menggunakan hosting...

Punyamu gak pernah diskonek ya?

If you have vps you can install PM2 and start node with pm2 ..

1 hour ago, Putra Pertama said:

@Magd Almuntaser

help please, on campaign and autoreply not work


ReferenceError: Cannot access 'inProgress' before initialization
    at sendBlastMessage (/home/waswupn/subdomain/waswupn.com/server/controllers/blast.js:40:3)
    at Layer.handle [as handle_request] (/home/waswupn/nodevenv/subdomain/waswupn.com/16/lib/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/waswupn/nodevenv/subdomain/waswupn.com/16/lib/node_modules/express/lib/router/route.js:149:13)
    at checkConnectionBeforeBlast (/home/waswupn/subdomain/waswupn.com/server/lib/middleware.js:34:5)

I will try to fix it .. 

And i see many problems with the owner he forget many things so i will fix it ..

comment_72016
3 hours ago, Magd Almuntaser said:

Jika Anda memiliki VPS, Anda dapat menginstal PM2 dan memulai node dengan pm2 ..

Saya akan mencoba memperbaikinya.. 

Dan saya melihat banyak masalah dengan pemiliknya, dia lupa banyak hal jadi saya akan memperbaikinya ..

Ketika nodejs berhenti lalu jalan lagi bagaimana caranya agar device bisa auto konek kembali?

Edited by pak kacung

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 2

Latest Updated Files