debian-mirror-gitlab/lib/gitlab/slash_commands/help.rb

29 lines
611 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
module Gitlab
2017-09-10 17:25:29 +05:30
module SlashCommands
2017-08-17 22:00:37 +05:30
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
def execute(commands, text)
2017-09-10 17:25:29 +05:30
Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
2017-08-17 22:00:37 +05:30
end
def trigger
params[:command]
end
end
end
end