def dispatch(core, request, endpoint, payload)
      intg = integration_for(core.config, endpoint)
      return [404, 'Endpoint not registered'] if intg.nil?
      return [403, 'Invalid signature'] unless valid?(request, intg, payload)

      req = create_request(intg, request, payload)
      return req if req.is_a? Array

      core.irc_client.dispatch(req)
      [202, 'Accepted']
    end
def dispatch(core, request, endpoint, payload)
      intg = integration_for(core.config, endpoint)
      return [404, 'Endpoint not registered'] if intg.nil?
      return [403, 'Invalid signature'] unless valid?(request, intg, payload)

      req = create_request(intg, request, payload)
      return req if req.is_a? Array

      core.irc_client.dispatch(req)
      [202, 'Accepted']
    end
Dispatches a received payload to the IRC client.

 @param core [Core] the bot to dispatch this request to
 @param request [Sinatra::Request] the request received by the web server
 @param endpoint [String] the endpoint at which the request was received
 @param payload [String] the payload that was sent to the endpoint
 @return [Array<Integer, String>] HTTP status code and response