summaryrefslogtreecommitdiffstats
path: root/api/command_shrug.go
blob: c49bd46aea10e6037706ea89abc9049f10f8552c (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
30
31
32
33
34
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package api

import (
	"github.com/mattermost/platform/model"
)

type ShrugProvider struct {
}

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

func (me *ShrugProvider) GetCommand() *model.Command {
	return &model.Command{
		Trigger:          "shrug",
		AutoComplete:     true,
		AutoCompleteDesc: `Adds ¯\_(ツ)_/¯ to your message`,
		AutoCompleteHint: "[message]",
		DisplayName:      "shrug",
	}
}

func (me *ShrugProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse {
	rmsg := `¯\\\_(ツ)\_/¯`
	if len(message) > 0 {
		rmsg = message + " " + rmsg
	}

	return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, Text: rmsg}
}