Skip to content

Commit d53e21a

Browse files
Twitch Clips: Add title and duration parameters (#395)
* Twitch Clips: Add title and duration parameters * fix: remove unneeded csharp props * fix: friendly type names for user-facing input dialogs --------- Co-authored-by: Whipstickgostop <8366326+Whipstickgostop@users.noreply.github.com>
1 parent 725b538 commit d53e21a

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

streamerbot/3.api/1.sub-actions/twitch/channel/create-clip.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Create Clip
3-
description: Create a 30-second Twitch Clip
3+
description: Create a Twitch Clip
4+
parameters:
5+
- name: Clip Title
6+
type: Text
7+
description: If blank, will match the stream title at the time of creation.
8+
- name: Duration
9+
type: Number
10+
default: 30
11+
description: Clip duration in seconds (min. 5, max 60).
412
variables:
513
- name: createClipSuccess
614
type: bool
@@ -21,11 +29,3 @@ variables:
2129
csharpMethods:
2230
- CreateClip
2331
---
24-
25-
::warning
26-
**Twitch API restrictions**
27-
- The generated clip will always be 30 seconds in length
28-
- The clip title will match your stream title at the time of creation
29-
30-
To make your own changes to the clip duration and/or title, you can manually edit the clip later.
31-
::
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
22
name: CreateClip
33
title: CreateClip
4-
description: Create a 30 second Twitch Clip
4+
description: Create a Twitch Clip
5+
parameters:
6+
- name: title
7+
description: If `null`, will match the stream title at the time of creation.
8+
- name: duration
9+
description: Clip duration in seconds (min. 5, max 60).
510
example: |
611
using System;
712
using Twitch.Common.Models.Api; //Needed for ClipData Type
813
public class CPHInline
914
{
1015
public bool Execute()
1116
{
12-
//Create Clip
13-
ClipData clip = CPH.CreateClip();
17+
//Create a 25 second clip titled "Example Title"
18+
ClipData clip = CPH.CreateClip("Example Title", 25);
1419
1520
//Access created clip data
1621
//Get clip creator name
@@ -24,12 +29,3 @@ example: |
2429
}
2530
}
2631
---
27-
28-
::warning
29-
**Twitch API restrictions**
30-
31-
- The generated clip will always be 30 seconds in length
32-
- The clip title will match your stream title at the time of creation
33-
34-
To make your own changes to the clip duration and/or title, you can manually edit the clip later.
35-
::

0 commit comments

Comments
 (0)