Skip to content

Commit f3c1d1c

Browse files
authored
Add paused to CustomReward.update() (#482)
* Add pause to CustomReward.update()
1 parent bad0efa commit f3c1d1c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

twitchio/http.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ async def patch_custom_reward(
938938
max_per_stream: int | None = None,
939939
max_per_user: int | None = None,
940940
global_cooldown: int | None = None,
941+
paused: bool | None = None,
941942
skip_queue: bool | None = None,
942943
) -> CustomRewardsResponse:
943944
params = {
@@ -979,6 +980,9 @@ async def patch_custom_reward(
979980
data["max_per_user_per_stream"] = max_per_user
980981
data["is_max_per_user_per_stream_enabled"] = max_per_user != 0
981982

983+
if paused is not None:
984+
data["is_paused"] = paused
985+
982986
if global_cooldown is not None:
983987
data["global_cooldown_seconds"] = global_cooldown
984988
data["is_global_cooldown_enabled"] = global_cooldown != 0

twitchio/models/channel_points.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class CustomReward:
9393
The cost of the reward in Channel Points.
9494
default_image: dict[str, str]
9595
A dictionary of default images for the reward. The keys are as follows: url_1x, url_2x and url_4x.
96-
background_color: Colour
97-
The background colour to use for the reward.
96+
colour: Colour
97+
The background colour to use for the reward. There is an alias named ``color``.
9898
enabled: bool
9999
A Boolean value that determines whether the reward is enabled. Is True if enabled; otherwise, False. Disabled rewards aren't shown to the user.
100100
input_required: bool
@@ -245,6 +245,7 @@ async def update(
245245
max_per_stream: int | None = None,
246246
max_per_user: int | None = None,
247247
global_cooldown: int | None = None,
248+
paused: bool | None = None,
248249
skip_queue: bool | None = None,
249250
) -> CustomReward:
250251
"""Update the custom reward.
@@ -258,14 +259,15 @@ async def update(
258259
Parameters
259260
-----------
260261
title: str | None
261-
The user's token that has permission manage the reward.
262+
The reward's title.
263+
The title may contain a maximum of 45 characters and it must be unique amongst all of the broadcaster's custom rewards.
262264
cost: int | None
263265
The cost of the reward, in channel points. The minimum is 1 point.
264266
prompt: str | None
265267
The prompt shown to the viewer when they redeem the reward.
266-
``input_required``` needs to be set to ``True`` for this to work,
268+
``input_required`` needs to be set to ``True`` for this to work,
267269
enabled: bool | None
268-
Boolean value that indicates whether the reward is enabled. Set to True to enable the reward. Viewers see only enabled rewards.
270+
Boolean value that indicates whether the reward is enabled. Set to ``True`` to enable the reward. Viewers see only enabled rewards.
269271
background_color: str | Colour | None
270272
The background color to use for the reward. Specify the color using Hex format (for example, #00E5CB).
271273
You can also pass a twitchio.Colour object.
@@ -280,6 +282,8 @@ async def update(
280282
global_cooldown: int | None
281283
The cooldown period, in seconds. The minimum value is 1; however, for it to be shown in the Twitch UX, the minimum value is 60.
282284
Setting this to 0 disables the global cooldown period.
285+
paused: bool | None
286+
A Boolean value that determines whether to pause the reward. Set to ``True`` to pause the reward. Viewers can't redeem paused rewards.
283287
skip_queue: bool | None
284288
A Boolean value that determines whether redemptions should be set to FULFILLED status immediately when a reward is redeemed.
285289
If False, status is set to UNFULFILLED and follows the normal request queue process.
@@ -318,6 +322,7 @@ async def update(
318322
max_per_stream=max_per_stream,
319323
max_per_user=max_per_user,
320324
global_cooldown=global_cooldown,
325+
paused=paused,
321326
skip_queue=skip_queue,
322327
)
323328

0 commit comments

Comments
 (0)