Add plugin slash command support (#7941)
* add plugin slash command support * remove unused string * rebase
Этот коммит содержится в:
@@ -32,6 +32,14 @@ func (api *LocalAPI) LoadPluginConfiguration(args struct{}, reply *[]byte) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (api *LocalAPI) RegisterCommand(args *model.Command, reply *APITeamReply) error {
|
||||
return api.api.RegisterCommand(args)
|
||||
}
|
||||
|
||||
func (api *LocalAPI) UnregisterCommand(args *APIUnregisterCommandArgs, reply *APITeamReply) error {
|
||||
return api.api.UnregisterCommand(args.TeamId, args.Trigger)
|
||||
}
|
||||
|
||||
type APIErrorReply struct {
|
||||
Error *model.AppError
|
||||
}
|
||||
@@ -344,6 +352,22 @@ func (api *RemoteAPI) LoadPluginConfiguration(dest interface{}) error {
|
||||
return json.Unmarshal(config, dest)
|
||||
}
|
||||
|
||||
func (api *RemoteAPI) RegisterCommand(command *model.Command) error {
|
||||
return api.client.Call("LocalAPI.RegisterCommand", command, nil)
|
||||
}
|
||||
|
||||
type APIUnregisterCommandArgs struct {
|
||||
TeamId string
|
||||
Trigger string
|
||||
}
|
||||
|
||||
func (api *RemoteAPI) UnregisterCommand(teamId, trigger string) error {
|
||||
return api.client.Call("LocalAPI.UnregisterCommand", &APIUnregisterCommandArgs{
|
||||
TeamId: teamId,
|
||||
Trigger: trigger,
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (api *RemoteAPI) CreateUser(user *model.User) (*model.User, *model.AppError) {
|
||||
var reply APIUserReply
|
||||
if err := api.client.Call("LocalAPI.CreateUser", user, &reply); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user