Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
botkit-sms
Advanced tools
botkit-sms
allows you to create conversational SMS apps ("bots") via Twilio's Programmable SMS API using Botkit's familiar interface.
It takes advantage of Botkit's core functionality thus allowing you to create complex conversational flows via a simple interface. It also allows you to use custom storage methods/systems to enable data persistence across sessions.
Here's an excerpt of Botkit's readme.md
file:
[Botkit] provides a semantic interface to sending and receiving messages so that developers can focus on creating novel applications and experiences instead of dealing with API endpoints.
You can use botkit-sms
to build SMS bots with moderately-complex conversational flows.
$ npm install --save botkit-sms
Note: This document assumes that you are familiarized with Botkit and Twilio's Programmable SMS API
To connect your bot to Twilio you must point a Messaging webhook to http://your_host/sms/receive, after doing so, every Twilio message will be sent to that address.
Then you need to write your bot. First, create a TwilioSMSBot instance and pass an object with your configuration properties:
account_sid
: found in your Twilio Console Dashboardauth_token
: found in your Twilio Console Dashboardtwilio_number
: your app's phone number, found in your Phone Numbers Dashboard The phone number format must be: +15551235555
const TwilioSMSBot = require('botkit-sms')
const controller = TwilioSMSBot({
account_sid: process.env.TWILIO_ACCOUNT_SID,
auth_token: process.env.TWILIO_AUTH_TOKEN,
twilio_number: process.env.TWILIO_NUMBER
})
spawn()
your bot instance:
let bot = controller.spawn({})
Then you need to set up your Web server and create the webhook endpoints so your app can receive Twilio's messages:
controller.setupWebserver(process.env.PORT, function (err, webserver) {
controller.createWebhookEndpoints(controller.webserver, bot, function () {
console.log('TwilioSMSBot is online!')
})
})
And finally, you can setup listeners for specific messages, like you would in any other botkit
bot:
controller.hears(['hi', 'hello'], 'message_received', (bot, message) => {
bot.startConversation(message, (err, convo) => {
convo.say('Hi, I am Oliver, an SMS bot! :D')
convo.ask('What is your name?', (res, convo) => {
convo.say(`Nice to meet you, ${res.text}!`)
convo.next()
})
})
})
controller.hears('.*', 'message_received', (bot, message) => {
bot.reply('huh?')
})
See full example in the examples
directory of this repo.
Please see botkit
's guide and reference document here.
Something does not work as expected or perhaps you think this module needs a feature? Please open an issue using GitHub's issue tracker. Please be as specific and straightforward as possible.
Pull Requests (PRs) are welcome. Make sure you follow the same basic stylistic conventions as the original code (i.e. "JavaScript standard code style"). Your changes must be concise and focus on solving a single problem.
Copyright (c) 2016 Kristian Muñiz
FAQs
Twilio Programmable SMS implementation for Botkit.
The npm package botkit-sms receives a total of 14 weekly downloads. As such, botkit-sms popularity was classified as not popular.
We found that botkit-sms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.