lib/slackify/router.rb
# Call command based on message string
Call command based on message string
Call command based on message string
def call_command(message, params)
        command = matching_command(message)
        if command.nil?
          return unless Slackify.configuration.unhandled_handler
          Slackify.configuration.unhandled_handler.unhandled(params)
        else
          new_params = params.merge(command_arguments: command.regex.match(message).named_captures)
          command.handler.call(new_params)
        end
      end
def call_command ( message , params ) command = matching_command ( message ) if command . nil? return unless Slackify . configuration . unhandled_handler Slackify . configuration . unhandled_handler . unhandled ( params ) else new_params = params . merge ( command_arguments : command . regex . match ( message ) . named_captures ) command . handler . call ( new_params ) end end
Call command based on message string
Call command based on message string
message
<not_specific>
params
<not_specific>