github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/app/command_open.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package app 5 6 import ( 7 goi18n "github.com/mattermost/go-i18n/i18n" 8 "github.com/vnforks/kid/v5/model" 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 }