github.com/keys-pub/mattermost-server@v4.10.10+incompatible/app/command_open.go (about)

     1  // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package app
     5  
     6  import (
     7  	"github.com/mattermost/mattermost-server/model"
     8  	goi18n "github.com/nicksnyder/go-i18n/i18n"
     9  )
    10  
    11  type OpenProvider struct {
    12  	JoinProvider
    13  }
    14  
    15  const (
    16  	CMD_OPEN = "open"
    17  )
    18  
    19  func init() {
    20  	RegisterCommandProvider(&OpenProvider{})
    21  }
    22  
    23  func (open *OpenProvider) GetTrigger() string {
    24  	return CMD_OPEN
    25  }
    26  
    27  func (open *OpenProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command {
    28  	cmd := open.JoinProvider.GetCommand(a, T)
    29  	cmd.Trigger = CMD_OPEN
    30  	cmd.DisplayName = T("api.command_open.name")
    31  	return cmd
    32  }