def post_message(text, options = {})
      payload = {
        username: @options['name'],
        channel:  @options['channel'],
        text:     text,
        as_user:  true
      }.merge(options)

      unless direct_message?(payload[:channel])
        payload[:channel] = enforce_leading_hash(payload[:channel])
        @api.join(payload[:channel])
      end

      @api.post_message(payload)
      return nil # be quiet in webhook reply
    end
def post_message(text, options = {})
      payload = {
        username: @options['name'],
        channel:  @options['channel'],
        text:     text,
        as_user:  true
      }.merge(options)

      unless direct_message?(payload[:channel])
        payload[:channel] = enforce_leading_hash(payload[:channel])
        @api.join(payload[:channel])
      end

      @api.post_message(payload)
      return nil # be quiet in webhook reply
    end
simple wrapper on api.post_message (which calls chat.postMessage)