im trying to send sms message to slack, i have it where the message is posted. the problem im having is that the twilio console gives a 11200 error on every message.
/** * Dependencies: * Dotenv, Express, BodyParser, Slack Web Client, Slack Events API */ require('dotenv').config(); const express = require('express'); const bodyParser = require('body-parser'); const createSlackEventAdapter = require('@slack/events-api').createSlackEventAdapter; //a new export, ErrorCode, is a dictionary of known error types const { WebClient } = require('@slack/client'); const twilio = require('twilio'); const firebase = require('firebase'); // Creates our express app const app = express(); // The channel we'll send TalkBot messages to const channel = 'CBY5883L3'; // The port we'll be using for our Express server const PORT = 3000; // Use BodyParser for app app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); /** * Tokens: * Slack, Firebase, Twilio */ //Retrieve bot token from dotenv file const bot_token = process.env.SLACK_BOT_TOKEN || ''; // Authorization token const auth_token = process.env.SLACK_AUTH_TOKEN || ''; // Verification token for Events Adapter const slackEvents = createSlackEventAdapter(process.env.SLACK_VERIFICATION_TOKEN); //Slack web client const web = new WebClient(auth_token); const bot = new WebClient(bot_token); //Twilio tokens const twilio_sid = process.env.TWILIO_SID || ''; const twilio_auth = process.env.TWILIO_AUTH_TOKEN || ''; // Initialize Twilio client using our Twilio SID and Authorization token const twilioClient = twilio(twilio_sid, twilio_auth); app.listen(PORT, function (err) { if (err) { throw err } console.log('Server started on port 3000') }) // Handles incoming SMS to Twilio number app.post('/sms', function (req, res) { const body = req.body.Body const num = req.body.From // Sends message to Slack - in format from { // `res` contains information about the posted message console.log('Message sent: ', res.ts); }) .catch(console.error); }