summaryrefslogtreecommitdiffstats
path: root/api/command_me.go
blob: f0154fe53a1b3ffaa3de2dba23e219219c90d9dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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 {
}

func init() {
	RegisterCommandProvider(&MeProvider{})
}

func (me *MeProvider) GetCommand() *model.Command {
	return &model.Command{
		Trigger:          "me",
		AutoComplete:     true,
		AutoCompleteDesc: "Do an action",
		AutoCompleteHint: "[message]",
		DisplayName:      "me",
	}
}

func (me *MeProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
	return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, Text: "*" + message + "*"}
}