helper.js
/* Makes API request based on event type */
Makes API request based on event type
Makes API request based on event type
function actionToMessage(response) {
  web.chat.postMessage({ channel: response.channel, text: response.message, mrkdwn: true })
    .then((res) => {
      console.log("Message sent: ", res.ts);
    })
    .catch((error) => {
      switch (error.data.error) {
        case "invalid_auth":
          token = undefined;
          respondToEvent(response.event); 
          break;
        default:
          console.log(error);
      }
    });
}
function actionToMessage ( response ) { web . chat . postMessage ( { channel : response . channel , text : response . message , mrkdwn : true } ) . then ( ( res ) => { console . log ( "Message sent: " , res . ts ) ; } ) . catch ( ( error ) => { switch ( error . data . error ) { case "invalid_auth" : token = undefined ; respondToEvent ( response . event ) ; break ; default : console . log ( error ) ; } } ) ; }
Makes API request based on event type
Makes API request based on event type
// See: https://api.slack.com/methods/chat.postMessage // `res` contains information about the posted message // eslint-disable-line no-use-before-define