From 37ce4ee446a925f7b25087724a8bbecf3a6d54e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:18:38 +0000 Subject: [PATCH] build(deps): bump github.com/nicklaw5/helix/v2 in /src Bumps [github.com/nicklaw5/helix/v2](https://github.com/nicklaw5/helix) from 2.28.3 to 2.29.0. - [Release notes](https://github.com/nicklaw5/helix/releases) - [Commits](https://github.com/nicklaw5/helix/compare/v2.28.3...v2.29.0) --- updated-dependencies: - dependency-name: github.com/nicklaw5/helix/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/go.mod | 2 +- src/go.sum | 5 +- .../nicklaw5/helix/v2/SUPPORTED_ENDPOINTS.md | 1 + .../nicklaw5/helix/v2/moderation.go | 46 +++++++++++++++++++ src/vendor/modules.txt | 2 +- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/go.mod b/src/go.mod index 324873b..71c4c42 100644 --- a/src/go.mod +++ b/src/go.mod @@ -4,7 +4,7 @@ go 1.22 require ( github.com/go-git/go-git/v5 v5.12.0 - github.com/nicklaw5/helix/v2 v2.28.3 + github.com/nicklaw5/helix/v2 v2.29.0 github.com/nikoksr/notify v0.41.0 github.com/sirupsen/logrus v1.9.3 ) diff --git a/src/go.sum b/src/go.sum index 1b89ed2..70a14a5 100644 --- a/src/go.sum +++ b/src/go.sum @@ -34,7 +34,6 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -54,8 +53,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/nicklaw5/helix/v2 v2.28.3 h1:hpy+VxMhEgDCoh8wAUS3mIqUYh0KcfJnd8w8uUOjZ3Y= -github.com/nicklaw5/helix/v2 v2.28.3/go.mod h1:zZcKsyyBWDli34x3QleYsVMiiNGMXPAEU5NjsiZDtvY= +github.com/nicklaw5/helix/v2 v2.29.0 h1:cmdU85H2QlYTqFokJO5xbjObIrtLLkgK8LdExDWyuFs= +github.com/nicklaw5/helix/v2 v2.29.0/go.mod h1:zZcKsyyBWDli34x3QleYsVMiiNGMXPAEU5NjsiZDtvY= github.com/nikoksr/notify v0.41.0 h1:4LGE41GpWdHX5M3Xo6DlWRwS2WLDbOq1Rk7IzY4vjmQ= github.com/nikoksr/notify v0.41.0/go.mod h1:FoE0UVPeopz1Vy5nm9vQZ+JVmYjEIjQgbFstbkw+cRE= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= diff --git a/src/vendor/github.com/nicklaw5/helix/v2/SUPPORTED_ENDPOINTS.md b/src/vendor/github.com/nicklaw5/helix/v2/SUPPORTED_ENDPOINTS.md index 2c70ce5..0c6235c 100644 --- a/src/vendor/github.com/nicklaw5/helix/v2/SUPPORTED_ENDPOINTS.md +++ b/src/vendor/github.com/nicklaw5/helix/v2/SUPPORTED_ENDPOINTS.md @@ -77,6 +77,7 @@ - [x] Add Blocked Term - [x] Remove Blocked Term - [x] Delete Chat Messages +- [x] Get Moderated Channels - [x] Get Moderators - [x] Add Channel Moderator - [x] Remove Channel Moderator diff --git a/src/vendor/github.com/nicklaw5/helix/v2/moderation.go b/src/vendor/github.com/nicklaw5/helix/v2/moderation.go index e69c1dd..9d18806 100644 --- a/src/vendor/github.com/nicklaw5/helix/v2/moderation.go +++ b/src/vendor/github.com/nicklaw5/helix/v2/moderation.go @@ -380,3 +380,49 @@ func (c *Client) RemoveChannelModerator(params *RemoveChannelModeratorParams) (* return moderators, nil } + +// `UserID` must match the user ID in the User-Access token +type GetModeratedChannelsParams struct { + // Required + UserID string `query:"user_id"` + + // Optional + After string `query:"after"` + First int `query:"first"` +} + +type ModeratedChannel struct { + BroadcasterID string `json:"broadcaster_id"` + BroadcasterLogin string `json:"broadcaster_login"` + BroadcasterName string `json:"broadcaster_name"` +} + +type ManyModeratedChannels struct { + ModeratedChannels []ModeratedChannel `json:"data"` + Pagination Pagination `json:"pagination"` +} + +type GetModeratedChannelsResponse struct { + ResponseCommon + Data ManyModeratedChannels +} + +// GetModeratedChannels Gets a list of channels that the specified user has moderator privileges in. +// Required scope: user:read:moderated_channels +func (c *Client) GetModeratedChannels(params *GetModeratedChannelsParams) (*GetModeratedChannelsResponse, error) { + if params.UserID == "" { + return nil, errors.New("user id is required") + } + + resp, err := c.get("/moderation/channels", &ManyModeratedChannels{}, params) + if err != nil { + return nil, err + } + + moderatedChannels := &GetModeratedChannelsResponse{} + resp.HydrateResponseCommon(&moderatedChannels.ResponseCommon) + moderatedChannels.Data.ModeratedChannels = resp.Data.(*ManyModeratedChannels).ModeratedChannels + moderatedChannels.Data.Pagination = resp.Data.(*ManyModeratedChannels).Pagination + + return moderatedChannels, nil +} diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt index a01e4be..0e19094 100644 --- a/src/vendor/modules.txt +++ b/src/vendor/modules.txt @@ -130,7 +130,7 @@ github.com/jbenet/go-context/io # github.com/kevinburke/ssh_config v1.2.0 ## explicit github.com/kevinburke/ssh_config -# github.com/nicklaw5/helix/v2 v2.28.3 +# github.com/nicklaw5/helix/v2 v2.29.0 ## explicit; go 1.19 github.com/nicklaw5/helix/v2 # github.com/nikoksr/notify v0.41.0