Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

r-functions

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

r-functions

Functions for bot whatsapp

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
0
Weekly downloads
 
Created
Source

Function for bot whatsapp

Example:

// declaration variable conn
const conn = client.conn

// send a text message (auto tagged)
conn.reply(m.chat, `Hello World`, m)

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

// send a text message with progress bar
conn.sendProgress(m.chat, `Hello World`, m)

// send a ptv message from path, url, or buffer (video duration 10s)
conn.sendPtv(m.chat, `./src/video/tiktok.mp4`)

// send a text message with custom thumbnail
conn.sendMessageModify(m.chat, `Hello World`, m, {
   title: '© pycos-bot',
   largeThumb: true,
   ads: false,
   /* can buffer or url */
   thumbnail: 'https://telegra.ph/file/a7ac2b46f82ef7ea083f9.jpg',
   link: 'httpsr-devs.xyz'
})

// send a text message with custom thumbnail & fake quoted
conn.sendMessageModifyV2(m.chat, `Hello World`, '© pycos-bot', {
   title: '© pycos-bot',
   largeThumb: true,
   ads: false,
   /* can buffer or url */
   thumbnail: 'https://telegra.ph/file/a7ac2b46f82ef7ea083f9.jpg',
   link: 'https://r-devs.xyz'
})

// send a text message with fake quoted
conn.sendMessageVerify(m.chat, `Hello World`, '© pycos-bot')

// send a file from path, url, or buffer (auto extension)
conn.sendFile(m.chat, 'https://telegra.ph/file/a7ac2b46f82ef7ea083f9.jpg', 'image.jpg', 'Hello World', m)

// send a document from path, url, or buffer (auto extension)
conn.sendFile(m.chat, 'https://telegra.ph/file/a7ac2b46f82ef7ea083f9.jpg', 'image.jpg', 'Hello World', m, {
   document: true
})

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

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

// send a sticker message from url or buffer
conn.sendSticker(m.chat, 'https://telegra.ph/file/a7ac2b46f82ef7ea083f9.jpg', m, {
   packname: 'Powered by',
   author: '© pycos-bot'
})

// send polling message
conn.sendPoll(m.chat, 'Do u like this library?', {
   options: ['Yes bro', 'Not yet'],
   multiselect: false
})

// send contact message
conn.sendContact(m.chat, [{
   name: 'Rasya R.',
   number: '6285791346128',
   about: 'Developers'
}], m, {
   org: 'Developers Internasional',
   website: 'https://r-devs.xyz',
   email: 'contact@rasyafs.me'
})

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

// send button message (your own risk)
var buttons = [{
   name: "quick_reply",
   buttonParamsJson: JSON.stringify({
      display_text: "Developer",
      id: '.devs'
   }),
}, {
   name: "cta_url",
   buttonParamsJson: JSON.stringify({
      display_text: "Website",
      url: "https://r-devs.xyz",
      merchant_url: "https://r-devs.xyz"
   })
}, {
   name: "cta_copy",
   buttonParamsJson: JSON.stringify({
      display_text: "Copy",
      copy_code: "987654"
   })
}, {
   name: "cta_call",
   buttonParamsJson: JSON.stringify({
      display_text: "Call",
      phone_number: "6285791346128"
   })
}, {
   name: "single_select",
   buttonParamsJson: JSON.stringify({
      title: "Click This!",
      sections: [{
         rows: [{
            title: "Owner",
            description: `Ny Developers`,
            id: `.owner`
         }, {
            title: "Runtime",
            description: `Runtime`,
            id: `.run`
         }]
      }]
   })
}]

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

// carousel message
const cards = [{
   header: {
      imageMessage: global.cover,
      hasMediaAttachment: true,
   },
   body: {
      text: "Hello World"
   },
   nativeFlowMessage: {
      buttons: [{
         name: "cta_url",
         buttonParamsJson: JSON.stringify({
            display_text: 'Contact Owner',
            url: 'https://r-devs.xyz',
            webview_presentation: null
         })
      }]
   }
}, {
   header: {
      imageMessage: global.cover,
      hasMediaAttachment: true,
   },
   body: {
      text: "Hello World"
   },
   nativeFlowMessage: {
      buttons: [{
         name: "cta_url",
         buttonParamsJson: JSON.stringify({
            display_text: 'Contact Owner',
            url: 'https://r-devs.xyz',
            webview_presentation: null
         })
      }]
   }
}]

client.sendCarousel(m.chat, cards, m, {
   content: 'Hello World!'
})

Thank You For

  • Allah SWT.
  • Nabi Muhammad SAW.
  • My Parrents.
  • My Friends.
  • Wildan

Keywords

FAQs

Package last updated on 10 Jul 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc