text: 'use strict'
  
  const express = require('express')
  const Slapp = require('slapp')
  const ConvoStore = require('slapp-convo-beepboop')
  const Context = require('slapp-context-beepboop')
  
  // use `PORT` env var on Beep Boop - default to 3000 locally
  var port = process.env.PORT || 3000
  
  var slapp = Slapp({
    // Beep Boop sets the SLACK_VERIFY_TOKEN env var
    verify_token: process.env.SLACK_VERIFY_TOKEN,
    convo_store: ConvoStore(),
    context: Context()
  })
  
  
  var HELP_TEXT = `
  *NO HELP FOR YOU, HUMAN*
  ...but you can ask @perry for help.
  `
  
  //*********************************************
  // Setup different handlers for messages
  //*********************************************
  
  // response to the user typing "help"
  slapp.message('help', ['direct_mention', 'direct_message'], (msg) => {
    msg.say(HELP_TEXT)
  })
  
  
  //var BRO_TEXT = `
  //Nice post, Perry
  //`
  
  //slapp.message('.*', (msg, text) => {
  //  if (msg.body.event.user == 'U18TT99MY') {
  //    msg.say(BRO_TEXT)
  //  }
  //})
  
  
  slapp.message('[?]$', (msg) => {
    if (msg.body.event.channel == 'C1924SRPG') {
      var str = msg.body.event.text
      var str1 = str.replace(/[^a-zA-Z1-9 ]/g, '');
      var str2 = str1.replace(/[ ]/g, '\+');
      msg.say('http://stackexchange.com/search?q=%5Br%5D+' + str2)
    }
  })
  
  // attach Slapp to express server
  var server = slapp.attachToExpress(express())
  
  // start http server
  server.listen(port, (err) => {
    if (err) {
      return console.error(err)
    }
  
    console.log(`Listening on port ${port}`)
  })
  