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

33 lines
673 B
Ruby
Raw Permalink Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
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)
2019-12-04 20:38:33 +05:30
Gitlab::SlashCommands::Presenters::Help
.new(project, commands)
.present(trigger, text)
2017-08-17 22:00:37 +05:30
end
def trigger
params[:command]
end
end
end
end