summaryrefslogtreecommitdiffstats
path: root/api/command_me.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-09 08:54:07 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-09 08:54:07 -0600
commitb1a7c1acf139efbb5312b4aa939bd94155e6a9e6 (patch)
treee47ec1ff21092af62b7be1218ba56472fcb60fad /api/command_me.go
parent25538df397f46d03b99a4b492bcef7cf68859a8a (diff)
downloadchat-b1a7c1acf139efbb5312b4aa939bd94155e6a9e6.tar.gz
chat-b1a7c1acf139efbb5312b4aa939bd94155e6a9e6.tar.bz2
chat-b1a7c1acf139efbb5312b4aa939bd94155e6a9e6.zip
adding different commands
Diffstat (limited to 'api/command_me.go')
-rw-r--r--api/command_me.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/api/command_me.go b/api/command_me.go
new file mode 100644
index 000000000..f0154fe53
--- /dev/null
+++ b/api/command_me.go
@@ -0,0 +1,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 + "*"}
+}