Class: Banacle::SlashCommand::Handler

Inherits:
Handler
  • Object
show all
Defined in:
lib/banacle/slash_command/handler.rb

Instance Attribute Summary

Attributes inherited from Handler

#auth, #request

Instance Method Summary collapse

Methods inherited from Handler

#handle, #set_authenticator!

Instance Method Details

#handle_requestObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/banacle/slash_command/handler.rb', line 9

def handle_request
  unless authenticated?
    return Renderer.render_unauthenticated
  end

  begin
    command = Parser.parse(request_text)
  rescue Error => e
    return Renderer.render_error(e)
  end

  Renderer.render(request.params, command)
end