Files
mattermost/api/command_me.go

38 lines
850 B
Go
Raw Normal View History

2016-01-09 08:54:07 -06:00
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package api
import (
"github.com/mattermost/platform/model"
)
type MeProvider struct {
}
2016-02-01 18:52:43 -08:00
const (
CMD_ME = "me"
)
2016-01-09 08:54:07 -06:00
func init() {
RegisterCommandProvider(&MeProvider{})
}
2016-02-01 18:52:43 -08:00
func (me *MeProvider) GetTrigger() string {
return CMD_ME
}
func (me *MeProvider) GetCommand(c *Context) *model.Command {
2016-01-09 08:54:07 -06:00
return &model.Command{
2016-02-01 18:52:43 -08:00
Trigger: CMD_ME,
2016-01-09 08:54:07 -06:00
AutoComplete: true,
2016-02-01 18:52:43 -08:00
AutoCompleteDesc: c.T("api.command_me.desc"),
AutoCompleteHint: c.T("api.command_me.hint"),
DisplayName: c.T("api.command_me.name"),
2016-01-09 08:54:07 -06:00
}
}
func (me *MeProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, Text: "*" + message + "*"}
}