Socket
Book a DemoInstallSign in
Socket

@im-dims/dims-js

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@im-dims/dims-js

Simplicity WhatsApp Bot (Baileys)

0.4.3
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

Simplicity WhatsApp Bot (Baileys)

This is a WhatsApp bot module based on Baileys which can be used in a very easy way.

Get Started

const loli = new(require('@im-dims/dims-js'))
console.log(loli)

Event Message (message)

WebMessageInfo {
  messageStubParameters: [],
  labels: [],
  userReceipt: [],
  reactions: [],
  pollUpdates: [],
  eventResponses: [],
  key: MessageKey {
    remoteJid: '1234@g.us',
    fromMe: false,
    id: '32797FA1DDA4B27626EC95E76B0E7CC5',
    participant: '628999@s.whatsapp.net'
  },
  message: Message { conversation: '=> m' },
  messageTimestamp: Long { low: 1730019648, high: 0, unsigned: true },
  broadcast: false,
  pushName: 'Dimas',
  id: '32797FA1DDA4B27626EC95E76B0E7CC5',
  isBaileys: false,
  chat: '1234@g.us',
  isGroup: true,
  sender: '628999@s.whatsapp.net',
  fromMe: false,
  mtype: 'conversation',
  msg: '=> m',
  text: '=> m',
  mentionedJid: [],
  quoted: null,
  name: 'Dimas',
  reply: [Function (anonymous)],
  react: [Function (anonymous)],
  copy: [Function (anonymous)],
  forward: [Function (anonymous)],
  copyNForward: [Function (anonymous)],
  cMod: [Function (anonymous)],
  delete: [Function (anonymous)],
  exp: 24,
  limit: false,
  plugin: 'owner-eval.js',
  isCommand: true
}

Messaging Function

// send a text message (auto tagged)
slips.reply(m.chat, `Test!`, m)

// send a react message
slips.sendReact(m.chat, `💀`, m.key)

// send a text message with progress bar
slips.sendProgress(m.chat, `Test!`, m)

// send a text message with custom thumbnail
slips.sendMessageModify(m.chat, 'Hi!', m, {
  title: '© mari-bot',
  largeThumb: true,
  /* can buffer or url */
  thumbnail: 'https://i.ibb.co/DfksZNg/image.jpg',
  link: 'https://chat.whatsapp.com/JDihQ498jwH9UKu8kFaT9N'
})

// send a file from path, url, or buffer (auto extension)
slips.sendFile(m.chat, 'https://i.ibb.co/DfksZNg/image.jpg', 'image.jpg', 'Test!', m)

// send a document from path, url, or buffer (auto extension)
slips.sendFile(m.chat, 'https://i.ibb.co/DfksZNg/image.jpg', 'image.jpg', 'Test!', m, {
  document: true
})

// send a voicenote from path, url, or buffer
slips.sendFile(m.chat, './media/audio/ah.mp3', '', '', m, {
  ptt: true
})

// send a audio from path, url, or buffer with thumbnail in audio tag
slips.sendFile(m.chat, './media/audio/ah.mp3', '', '', m, {
  APIC: < Buffer >
})

// send a sticker message from url or buffer
slips.sendSticker(m.chat, 'https://i.ibb.co/DfksZNg/image.jpg', m, {
  packname: 'Sticker by',
  author: '© mari-bot'
})

// send polling message
slips.sendPoll(m.chat, 'Do you like this library ?', {
  options: ['Yes', 'No'],
  multiselect: false
})

// send contact message
slips.sendContact(m.chat, [{
  name: 'Dimas T',
  number: '628999,
  about: 'Owner & Creator' 
}], m, {
  org: 'Dims Network',
  website: 'https://api.ssateam.my.id',
  email: 'dev@ssateam.my.id'
})

// forward message
slips.copyNForward(m.chat, m)

// send button message (your own risk)
var buttons = [{
   name: "quick_reply",
   buttonParamsJson: JSON.stringify({
      display_text: "OWNER",
      id: '.owner'
   }),
}, {
   name: "cta_url",
   buttonParamsJson: JSON.stringify({
      display_text: "Rest API",
      url: "https://api.neoxr.my.id",
      merchant_url: "https://api.neoxr.my.id"
   })
}, {
   name: "cta_copy",
   buttonParamsJson: JSON.stringify({
      display_text: "Copy",
      copy_code: "123456"
   })
}, {
   name: "cta_call",
   buttonParamsJson: JSON.stringify({
      display_text: "Call",
      phone_number: "6285887776722"
   })
}, {
   name: "single_select",
   buttonParamsJson: JSON.stringify({
      title: "Tap!",
      sections: [{
         rows: [{
            title: "Owner",
            description: `X`,
            id: `.owner`
         }, {
            title: "Runtime",
            description: `Y`,
            id: `.run`
         }]
      }]
   })
}]

// button & list
slips.sendIAMessage(m.chat, buttons, m, {
  header: '',
  content: 'Hi!',
  footer: '',
  media: global.db.setting.cover // video or image link
})

Thanks To (Source of Ideas)

Neoxr Wildan

Staff Contribute

Im-Dims Xyro Fainshe

FAQs

Package last updated on 08 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.