adding different commands
Этот коммит содержится в:
29
api/command_shrug.go
Обычный файл
29
api/command_shrug.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 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 {
|
||||
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, Text: `¯\_(ツ)_/¯`}
|
||||
}
|
||||
Ссылка в новой задаче
Block a user