Files
mattermost/app/command_shrug.go

44 lines
1.0 KiB
Go
Raw Normal View History

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
2016-01-09 08:54:07 -06:00
// See License.txt for license information.
package app
2016-01-09 08:54:07 -06:00
import (
goi18n "github.com/mattermost/go-i18n/i18n"
2017-09-06 23:05:10 -07:00
"github.com/mattermost/mattermost-server/model"
2016-01-09 08:54:07 -06:00
)
type ShrugProvider struct {
}
2016-02-01 18:52:43 -08:00
const (
CMD_SHRUG = "shrug"
)
2016-01-09 08:54:07 -06:00
func init() {
RegisterCommandProvider(&ShrugProvider{})
}
2016-02-01 18:52:43 -08:00
func (me *ShrugProvider) GetTrigger() string {
return CMD_SHRUG
}
2017-11-09 14:46:20 -06:00
func (me *ShrugProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command {
2016-01-09 08:54:07 -06:00
return &model.Command{
2016-02-01 18:52:43 -08:00
Trigger: CMD_SHRUG,
2016-01-09 08:54:07 -06:00
AutoComplete: true,
AutoCompleteDesc: T("api.command_shrug.desc"),
AutoCompleteHint: T("api.command_shrug.hint"),
DisplayName: T("api.command_shrug.name"),
2016-01-09 08:54:07 -06:00
}
}
2017-09-14 12:01:44 -05:00
func (me *ShrugProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
2016-01-09 09:22:14 -06:00
rmsg := `¯\\\_(ツ)\_/¯`
if len(message) > 0 {
rmsg = message + " " + rmsg
}
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, Text: rmsg}
2016-01-09 08:54:07 -06:00
}