Answers for "twilio simon says command sample"

0

twilio simon says command sample

//echo.js
const MessagingResponse = require('twilio').twiml.MessagingResponse
const methods = {
    run: function(request, response) {
         // Strip the trigger word from the response.
        const message = request.Body.split(' ').slice(1).join(' ')

         // Create a new response object to send to Twilio.
        const twiml = new MessagingResponse()

        // Add the message to it, and send it back to Twilio.
        twiml.message(message)
        response.set('Content-Type', 'text/xml')
        response.send(twiml.toString())      
    },

    meta: {
        aliases: ['echo', 'echoinput', 'repeat', 'simonsays']
    }
}
module.exports = methods
Posted by: Guest on January-16-2021

Code answers related to "twilio simon says command sample"

Code answers related to "Javascript"

Browse Popular Code Answers by Language