Skip to content

Commit

Permalink
Set users IDs as array to get ban users list
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorfly committed May 8, 2024
1 parent 3b46324 commit c3a19f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions moderation.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ type BannedUsersResponse struct {
// BroadcasterID must match the auth tokens user_id
type BannedUsersParams struct {
BroadcasterID string `query:"broadcaster_id"`
UserID string `query:"user_id"`
After string `query:"after"`
Before string `query:"before"`
// Filter by provided UserIDs
UserID []string `query:"user_id"`
After string `query:"after"`
Before string `query:"before"`
}

// GetBannedUsers returns all banned and timed-out users in a channel.
Expand Down
6 changes: 3 additions & 3 deletions moderation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestGetBannedUsers(t *testing.T) {
statusCode int
options *Options
BroadcasterID string
UserID string
UserID []string
After string
Before string
respBody string
Expand All @@ -23,7 +23,7 @@ func TestGetBannedUsers(t *testing.T) {
http.StatusBadRequest,
&Options{ClientID: "my-client-id"},
"", // missing broadcaster id
"",
[]string{},
"",
"",
`{"error":"Bad Request","status":400,"message":"Missing required parameter \"broadcaster_id\""}`,
Expand All @@ -32,7 +32,7 @@ func TestGetBannedUsers(t *testing.T) {
http.StatusOK,
&Options{ClientID: "my-client-id"},
"23161357",
"",
[]string{},
"",
"",
`{"data":[{"expires_at":"","user_id":"54946241","user_name":"chronophylos","user_name":"chronophylos"},{"expires_at":"2022-03-15T02:00:28Z","user_id":"423374343","user_name":"glowillig"}],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19"}}`,
Expand Down

0 comments on commit c3a19f4

Please sign in to comment.