npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@im-dims/utils

v0.2.7

Published

function for kasumi bot

Readme

SIMPLICITY WHATSAPP BOT

A clean and efficient WhatsApp bot library powered by Baileys. Built to simplify bot development, making it easier to build, adapt, and run your WhatsApp automation with minimal effort.

Example

To see an example in action, visit the kasumi-bot repository.

Connection

Simple way to make connection

const { Connection, Functions: Func, Config: env } = new (require('@im-dims/utils'))
const conn = new Connection({
   directory: 'plugins',
   session: 'session',
   online: true,
   bypass_ephemeral: true,
   version: [2, 3000, 1022545672] // To see the latest version : https://wppconnect.io/whatsapp-versions/
}, {
   shouldIgnoreJid: jid => {
      return /(newsletter|bot)/.test(jid)
   }
})

Handling Events

There are several events that can be used are as follows :

conn.once('slips', ex => console.log(ex))
conn.once('prepare', () => console.log)
conn.once('poll', ctx => console.log(ctx))
conn.ev('message.delete', ctx => console.log(ctx))
conn.ev('presence.update', ctx => console.log(ctx))
conn.ev('group-participants.update', ctx => console.log(ctx))
conn.ev('group.detect', ctx => console.log(ctx))
conn.ev('call', ctx => console.log(ctx))
conn.ev('message.reaction', ctx => console.log(ctx))
conn.ev('groups.update', ctx => console.log(ctx))
conn.ev('chats.update', ctx => console.log(ctx))
conn.ev('contacts.update', ctx => console.log(ctx))
conn.ev('contacts.upsert', ctx => console.log(ctx))
conn.ev('message-receipt.update', ctx => console.log(ctx))

Message Metadata

WebMessageInfo {
  messageStubParameters: [],
  labels: [],
  userReceipt: [],
  reactions: [],
  pollUpdates: [],
  eventResponses: [],
  statusMentions: [],
  messageAddOns: [],
  statusMentionSources: [],
  supportAiCitations: [],
  key: MessageKey {
    remoteJid: '[email protected]',
    fromMe: false,
    id: '4F38BA4A38B5BBFCAF62447AE7C2FE77',
    participant: '[email protected]'
  },
  message: { conversation: '=> m' },
  messageTimestamp: Long { low: 1749750736, high: 0, unsigned: true },
  broadcast: false,
  pushName: 'Xyuzu Is Here!',
  _text: '=> m'
}

Messaging Function

// declaration variable sock
const slips = conn.sock

// 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 ptv message from path, url, or buffer (video duration 10s)
slips.sendPtv(m.chat, './src/video/aiskurimu.mp4')

// send a text message with custom thumbnail
slips.sendMessageModify(m.chat, 'Test!', m, {
   title: '© kasumi-bot',
   largeThumb: true,
   ads: false,
   /* can buffer or url */
   thumbnail: 'https://qu.ax/ABlXC.jpg',
   link: 'https://whatsapp.com/channel/0029VaDs0ba1SWtAQnMvZb0U'
})

// send a file from path, url, or buffer (auto extension)
slips.sendFile(m.chat, 'https://qu.ax/55', 'image.jpg', 'Test!', m)

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

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

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

// send a sticker message from url or buffer
slips.sendSticker(m.chat, 'https://qu.ax/ABlXC.jpg', m, {
   packname: 'Sticker by',
   author: '© kasumi-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 Triyatno',
   number: '6282128385538',
   about: 'Owner & Creator'
}], m, {
   org: 'Kasumi Support',
   website: 'https://api.ssateam.my.id',
   email: '[email protected]'
})

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

// send interactive 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.ssateam.my.id',
      merchant_url: 'https://api.ssateam.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: '6282128385538'
   })
}, {
   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
})

// carousel message
const cards = [{
   header: {
      imageMessage: global.db.setting.cover,
      hasMediaAttachment: true,
   },
   body: {
      text: 'P'
   },
   nativeFlowMessage: {
      buttons: [{
         name: 'cta_url',
         buttonParamsJson: JSON.stringify({
            display_text: 'Contact Owner',
            url: 'https://api.ssateam.my.id',
            webview_presentation: null
         })
      }]
   }
}, {
   header: {
      imageMessage: global.db.setting.cover,
      hasMediaAttachment: true,
   },
   body: {
      text: 'P'
   },
   nativeFlowMessage: {
      buttons: [{
         name: 'cta_url',
         buttonParamsJson: JSON.stringify({
            display_text: 'Contact Owner',
            url: 'https://api.ssateam.my.id',
            webview_presentation: null
         })
      }]
   }
}]

slips.sendCarousel(m.chat, cards, m, {
   content: 'Hi!'
})

// send message with "AI" label (only work if your bot using WhatsApp Business)
slips.replyAI(m.chat, 'Hi!', m)

Big Thanks To

Special thanks to Neoxr and Nando for their inspiring codebases that helped shape this project.

contributors