Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions clips.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ func (ccr *CreateClipResponse) GetClipsCreationRateLimitRemaining() int {
}

type CreateClipParams struct {
// BroadcasterID The ID of the broadcaster whose stream you want to create a clip from.
BroadcasterID string `query:"broadcaster_id"`

// Optional
HasDelay bool `query:"has_delay,false"`
// Optional. The title of the clip.
Title string `query:"title"`
// Optional. The length of the clip in seconds. Possible values range from 5 to 60 inclusively with a precision of 0.1. The default is 30.
Duration float32 `query:"duration"`
}

// CreateClip creates a clip programmatically. This returns both an ID and
Expand Down
8 changes: 8 additions & 0 deletions clips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ func TestCreateClip(t *testing.T) {
"600",
"598",
},
{
http.StatusAccepted,
&Options{ClientID: "my-client-id"},
&CreateClipParams{BroadcasterID: "26490481", Title: "Title", Duration: 0.5}, // summit1g
`{"data":[{"id":"IronicHedonisticOryxSquadGoals","edit_url":"https://clips.twitch.tv/IronicHedonisticOryxSquadGoals/edit"}]}`,
"600",
"598",
},
{
http.StatusUnauthorized,
&Options{ClientID: "my-client-id"},
Expand Down