From b1a7c1acf139efbb5312b4aa939bd94155e6a9e6 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sat, 9 Jan 2016 08:54:07 -0600 Subject: adding different commands --- api/command_logout.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 api/command_logout.go (limited to 'api/command_logout.go') diff --git a/api/command_logout.go b/api/command_logout.go new file mode 100644 index 000000000..01e81aaf0 --- /dev/null +++ b/api/command_logout.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 LogoutProvider struct { +} + +func init() { + RegisterCommandProvider(&LogoutProvider{}) +} + +func (me *LogoutProvider) GetCommand() *model.Command { + return &model.Command{ + Trigger: "logout", + AutoComplete: true, + AutoCompleteDesc: "Logout", + AutoCompleteHint: "", + DisplayName: "logout", + } +} + +func (me *LogoutProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse { + return &model.CommandResponse{GotoLocation: "/logout", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: "Logging out..."} +} -- cgit v1.2.3-1-g7c22