* Consistent license message for all the go files * Fixing the last set of unconsistencies with the license headers * Addressing PR review comments * Fixing busy.go and busy_test.go license header
43 строки
1.1 KiB
Go
43 строки
1.1 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
goi18n "github.com/mattermost/go-i18n/i18n"
|
|
"github.com/mattermost/mattermost-server/v5/model"
|
|
)
|
|
|
|
type ShortcutsProvider struct {
|
|
}
|
|
|
|
const (
|
|
CMD_SHORTCUTS = "shortcuts"
|
|
)
|
|
|
|
func init() {
|
|
RegisterCommandProvider(&ShortcutsProvider{})
|
|
}
|
|
|
|
func (me *ShortcutsProvider) GetTrigger() string {
|
|
return CMD_SHORTCUTS
|
|
}
|
|
|
|
func (me *ShortcutsProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command {
|
|
return &model.Command{
|
|
Trigger: CMD_SHORTCUTS,
|
|
AutoComplete: true,
|
|
AutoCompleteDesc: T("api.command_shortcuts.desc"),
|
|
AutoCompleteHint: "",
|
|
DisplayName: T("api.command_shortcuts.name"),
|
|
}
|
|
}
|
|
|
|
func (me *ShortcutsProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
|
|
// This command is handled client-side and shouldn't hit the server.
|
|
return &model.CommandResponse{
|
|
Text: args.T("api.command_shortcuts.unsupported.app_error"),
|
|
ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL,
|
|
}
|
|
}
|