diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/command_join.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/command_join.go b/api/command_join.go index a2b1a2ddf..dddba0135 100644 --- a/api/command_join.go +++ b/api/command_join.go @@ -45,6 +45,11 @@ func (me *JoinProvider) DoCommand(c *Context, channelId string, message string) if v.Type != model.CHANNEL_OPEN { return &model.CommandResponse{Text: c.T("api.command_join.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL} } + + if err, _ := JoinChannelById(c, c.Session.UserId, channelId); err != nil { + return &model.CommandResponse{Text: c.T("api.command_join.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL} + } + return &model.CommandResponse{GotoLocation: c.GetTeamURL() + "/channels/" + v.Name, Text: c.T("api.command_join.success"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL} } } |