[MM-9938] Add support for multiple responses from a slash command (#9836)
* slash command response now supports multiple posts * change wording of Posts to ExtraResponses
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
246ff89391
Коммит
a50e8ac5b9
@@ -277,6 +277,18 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
|
||||
}
|
||||
|
||||
func (a *App) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) {
|
||||
a.HandleCommandResponsePost(command, args, response, builtIn)
|
||||
|
||||
if response.ExtraResponses != nil {
|
||||
for _, resp := range response.ExtraResponses {
|
||||
a.HandleCommandResponsePost(command, args, resp, builtIn)
|
||||
}
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (a *App) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) {
|
||||
post := &model.Post{}
|
||||
post.ChannelId = args.ChannelId
|
||||
post.RootId = args.RootId
|
||||
|
||||
Ссылка в новой задаче
Block a user