diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index c30be31e8..943525420 100644 --- a/model/client4.go +++ b/model/client4.go @@ -2243,6 +2243,16 @@ func (c *Client4) ListAutocompleteCommands(teamId string) ([]*Command, *Response } } +// RegenCommandToken will create a new token if the user have the right permissions. +func (c *Client4) RegenCommandToken(commandId string) (string, *Response) { + if r, err := c.DoApiPut(c.GetCommandRoute(commandId)+"/regen_token", ""); err != nil { + return "", &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return MapFromJson(r.Body)["token"], BuildResponse(r) + } +} + // Status Section // GetUserStatus returns a user based on the provided user id string. |