summaryrefslogtreecommitdiffstats
path: root/api/command.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-05 09:00:57 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-05 09:00:57 -0800
commit0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb (patch)
tree182343657900829696e281620a3842e70f3ff2dd /api/command.go
parent4fabe574fadb3e35a5f87c31a421daf1cff57af8 (diff)
downloadchat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.tar.gz
chat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.tar.bz2
chat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.zip
Fixing slash commands
Diffstat (limited to 'api/command.go')
-rw-r--r--api/command.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/api/command.go b/api/command.go
index a8573cdcc..e6fc8df3c 100644
--- a/api/command.go
+++ b/api/command.go
@@ -214,12 +214,15 @@ func handleResponse(c *Context, w http.ResponseWriter, response *model.CommandRe
c.Err = model.NewLocAppError("command", "api.command.execute_command.save.app_error", nil, "")
}
} else if response.ResponseType == model.COMMAND_RESPONSE_TYPE_EPHEMERAL {
- // post := &model.Post{}
- // post.ChannelId = channelId
- // post.Message = "TODO_EPHEMERAL: " + response.Text
- // if _, err := CreatePost(c, post, true); err != nil {
- // c.Err = model.NewLocAppError("command", "api.command.execute_command.save.app_error", nil, "")
- // }
+ post := &model.Post{}
+ post.ChannelId = channelId
+ post.Message = response.Text
+ post.CreateAt = model.GetMillis()
+ SendEphemeralPost(
+ c.Session.TeamId,
+ c.Session.UserId,
+ post,
+ )
}
w.Write([]byte(response.ToJson()))