diff options
author | Wim <wim@42.be> | 2020-05-24 00:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 00:06:21 +0200 |
commit | 393f9e998b1b40aa59d3fb8794c3a73da38c3fb7 (patch) | |
tree | 2bc9b6e6abdbdc6d811b155997597bdae62bc7db /vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go | |
parent | ba0bfe70a8f07164e1341f4b094841acdad5c3a2 (diff) | |
download | matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.gz matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.bz2 matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.zip |
Update dependencies / vendor (#1146)
Diffstat (limited to 'vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go')
-rw-r--r-- | vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go index 71ec37d3..d3fa57ea 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go @@ -26,7 +26,11 @@ type ListUserMemberships struct { } func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetails, err error) { - apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": "%s"}}}`, teamName) + teamNameEscaped, err := json.Marshal(teamName) + if err != nil { + return res, err + } + apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": %s}}}`, teamNameEscaped) cmd := a.runOpts.Command("team", "api") cmd.Stdin = strings.NewReader(apiInput) var stderr bytes.Buffer @@ -51,7 +55,11 @@ func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetail } func (a *API) ListUserMemberships(username string) ([]keybase1.AnnotatedMemberInfo, error) { - apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": "%s"}}}`, username) + usernameEscaped, err := json.Marshal(username) + if err != nil { + return nil, err + } + apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": %s}}}`, usernameEscaped) cmd := a.runOpts.Command("team", "api") cmd.Stdin = strings.NewReader(apiInput) var stderr bytes.Buffer |