BigW Consortium Gitlab

help.rb 611 Bytes
Newer Older
Z.J. van de Weg committed
1
module Gitlab
2
  module SlashCommands
Z.J. van de Weg committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    class Help < BaseCommand
      # This class has to be used last, as it always matches. It has to match
      # because other commands were not triggered and we want to show the help
      # command
      def self.match(_text)
        true
      end

      def self.help_message
        'help'
      end

      def self.allowed?(_project, _user)
        true
      end

Z.J. van de Weg committed
19
      def execute(commands, text)
20
        Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
Z.J. van de Weg committed
21 22 23 24 25 26 27 28
      end

      def trigger
        params[:command]
      end
    end
  end
end