code: def start(token,
            control=False,
            trigger='!',
            groups=None,
            groups_pillar_name=None,
            fire_all=False,
            tag='salt/engines/slack'):
      '''
      Listen to slack events and forward them to salt, new version
      '''
  
      if (not token) or (not token.startswith('xoxb')):
          time.sleep(2)  # don't respawn too quickly
          log.error('Slack bot token not found, bailing...')
          raise UserWarning('Slack Engine bot token not configured')
  
      try:
          client = SlackClient(token=token)
          message_generator = client.generate_triggered_messages(token, trigger, groups, groups_pillar_name)
          client.run_commands_from_slack_async(message_generator, fire_all, tag, control)
      except Exception:
          raise Exception('{}'.format(traceback.format_exc())f start(token,
            control=False,
            trigger='!',
            groups=None,
            groups_pillar_name=None,
            fire_all=False,
            tag='salt/engines/slack'):
      '''
      Listen to slack events and forward them to salt, new version
      '''
  
      if (not token) or (not token.startswith('xoxb')):
          time.sleep(2)  # don't respawn too quickly
          log.error('Slack bot token not found, bailing...')
          raise UserWarning('Slack Engine bot token not configured')
  
      try:
          client = SlackClient(token=token)
          message_generator = client.generate_triggered_messages(token, trigger, groups, groups_pillar_name)
          client.run_commands_from_slack_async(message_generator, fire_all, tag, control)
      except Exception:
          raise Exception('{}'.format(traceback.format_exc()))
docs: Listen to slack events and forward them to salt, new version