ea090291bb
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070 Deprecate "chat commands" in favor of "slash commands" We looked for things like: - `slash commmand` - `slash_command` - `slash-command` - `SlashCommand`
28 lines
611 B
Ruby
28 lines
611 B
Ruby
module Gitlab
|
|
module SlashCommands
|
|
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)
|
|
Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
|
|
end
|
|
|
|
def trigger
|
|
params[:command]
|
|
end
|
|
end
|
|
end
|
|
end
|