|
39 | 39 | class CustomReward: |
40 | 40 | """ |
41 | 41 | Represents a Custom Reward object, as given by the api. Use :func:`User.get_custom_rewards` to fetch these |
| 42 | +
|
| 43 | + Attributes |
| 44 | + ----------- |
| 45 | + id: :class:`str` |
| 46 | + The id of the custom reward |
| 47 | + title: :class:`str` |
| 48 | + The title of the custom reward |
| 49 | + image: :class:`str` |
| 50 | + The url of the image of the custom reward |
| 51 | + background_color: :class:`str` |
| 52 | + The background color of the custom reward |
| 53 | + enabled: :class:`bool` |
| 54 | + Whether the custom reward is enabled |
| 55 | + cost: :class:`int` |
| 56 | + The cost of the custom reward |
| 57 | + prompt: :class:`str` |
| 58 | + The prompt of the custom reward |
| 59 | + input_required: :class:`bool` |
| 60 | + Whether the custom reward requires input |
| 61 | + max_per_stream: Tuple[:class:`bool`, :class:`int`] |
| 62 | + Whether the custom reward is limited to a certain amount per stream, and how many |
| 63 | + max_per_user_stream: Tuple[:class:`bool`, :class:`int`] |
| 64 | + Whether the custom reward is limited to a certain amount per user per stream, and how many |
| 65 | + cooldown: Tuple[:class:`bool`, :class:`int`] |
| 66 | + Whether the custom reward has a cooldown, and how long it is |
| 67 | + paused: :class:`bool` |
| 68 | + Whether the custom reward is paused |
| 69 | + in_stock: :class:`bool` |
| 70 | + Whether the custom reward is in stock |
| 71 | + redemptions_skip_queue: :class:`bool` |
| 72 | + Whether the custom reward's redemptions skip the request queue |
| 73 | + redemptions_current_stream: :class:`bool` |
| 74 | + Whether the custom reward's redemptions are only valid for the current stream |
| 75 | + cooldown_until: :class:`datetime.datetime` |
| 76 | + The datetime the custom reward's cooldown will expire |
42 | 77 | """ |
43 | 78 |
|
44 | 79 | __slots__ = ( |
@@ -112,41 +147,56 @@ def __init__(self, http: "TwitchHTTP", obj: dict, channel: "PartialUser"): |
112 | 147 | async def edit( |
113 | 148 | self, |
114 | 149 | token: str, |
115 | | - title: str = None, |
116 | | - prompt: str = None, |
117 | | - cost: int = None, |
118 | | - background_color: str = None, |
119 | | - enabled: bool = None, |
120 | | - input_required: bool = None, |
121 | | - max_per_stream_enabled: bool = None, |
122 | | - max_per_stream: int = None, |
123 | | - max_per_user_per_stream_enabled: bool = None, |
124 | | - max_per_user_per_stream: int = None, |
125 | | - global_cooldown_enabled: bool = None, |
126 | | - global_cooldown: int = None, |
127 | | - paused: bool = None, |
128 | | - redemptions_skip_queue: bool = None, |
| 150 | + title: Optional[str] = None, |
| 151 | + prompt: Optional[str] = None, |
| 152 | + cost: Optional[int] = None, |
| 153 | + background_color: Optional[str] = None, |
| 154 | + enabled: Optional[bool] = None, |
| 155 | + input_required: Optional[bool] = None, |
| 156 | + max_per_stream_enabled: Optional[bool] = None, |
| 157 | + max_per_stream: Optional[int] = None, |
| 158 | + max_per_user_per_stream_enabled: Optional[bool] = None, |
| 159 | + max_per_user_per_stream: Optional[int] = None, |
| 160 | + global_cooldown_enabled: Optional[bool] = None, |
| 161 | + global_cooldown: Optional[int] = None, |
| 162 | + paused: Optional[bool] = None, |
| 163 | + redemptions_skip_queue: Optional[bool] = None, |
129 | 164 | ): |
130 | 165 | """ |
131 | 166 | Edits the reward. Note that apps can only modify rewards they have made. |
132 | 167 |
|
133 | 168 | Parameters |
134 | 169 | ----------- |
135 | | - token: the bearer token for the channel of the reward |
136 | | - title: the new title of the reward |
137 | | - prompt: the new prompt for the reward |
138 | | - cost: the new cost for the reward |
139 | | - background_color: the new background color for the reward |
140 | | - enabled: whether the reward is enabled or not |
141 | | - input_required: whether user input is required or not |
142 | | - max_per_stream_enabled: whether the stream limit should be enabled |
143 | | - max_per_stream: how many times this can be redeemed per stream |
144 | | - max_per_user_per_stream_enabled: whether the user stream limit should be enabled |
145 | | - max_per_user_per_stream: how many times a user can redeem this reward per stream |
146 | | - global_cooldown_enabled: whether the global cooldown should be enabled |
147 | | - global_cooldown: how many seconds the global cooldown should be |
148 | | - paused: whether redemptions on this reward should be paused or not |
149 | | - redemptions_skip_queue: whether redemptions skip the request queue or not |
| 170 | + token: :class:`str` |
| 171 | + The bearer token for the channel of the reward |
| 172 | + title: Optional[:class:`str`] |
| 173 | + The new title of the reward |
| 174 | + prompt: Optional[:class:`str`] |
| 175 | + The new prompt for the reward |
| 176 | + cost: Optional[:class:`int`] |
| 177 | + The new cost for the reward |
| 178 | + background_color: Optional[:class:`str`] |
| 179 | + The new background color for the reward |
| 180 | + enabled: Optional[:class:`bool`] |
| 181 | + Whether the reward is enabled or not |
| 182 | + input_required: Optional[:class:`bool`] |
| 183 | + Whether user input is required or not |
| 184 | + max_per_stream_enabled: Optional[:class:`bool`] |
| 185 | + Whether the stream limit should be enabled |
| 186 | + max_per_stream: Optional[:class:`int`] |
| 187 | + How many times this can be redeemed per stream |
| 188 | + max_per_user_per_stream_enabled: Optional[:class:`bool`] |
| 189 | + Whether the user stream limit should be enabled |
| 190 | + max_per_user_per_stream: Optional[:class:`int`] |
| 191 | + How many times a user can redeem this reward per stream |
| 192 | + global_cooldown_enabled: Optional[:class:`bool`] |
| 193 | + Whether the global cooldown should be enabled |
| 194 | + global_cooldown: Optional[:class:`int`] |
| 195 | + How many seconds the global cooldown should be |
| 196 | + paused: Optional[:class:`bool`] |
| 197 | + Whether redemptions on this reward should be paused or not |
| 198 | + redemptions_skip_queue: Optional[:class:`bool`] |
| 199 | + Whether redemptions skip the request queue or not |
150 | 200 |
|
151 | 201 | Returns |
152 | 202 | -------- |
|
0 commit comments