Skip to content

Commit f4073c4

Browse files
committed
Add fetch_reward documentation
1 parent 4c436c4 commit f4073c4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

twitchio/models/eventsub_.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3604,6 +3604,20 @@ def get_image(self, size: Literal["1x", "2x", "4x"] = "2x", use_default: bool =
36043604
return Asset(url, http=self._http)
36053605

36063606
async def fetch_reward(self) -> CustomReward:
3607+
"""|coro|
3608+
3609+
Method to fetch and return the :class:`twitchio.CustomReward` associated with this event from the Twitch API.
3610+
3611+
Returns
3612+
-------
3613+
CustomReward
3614+
The reward object associated with this event, received from the Twitch API.
3615+
3616+
Raises
3617+
------
3618+
HTTPException
3619+
An error occurred making the request to Twitch to fetch the reward.
3620+
"""
36073621
reward = await self.broadcaster.fetch_custom_rewards(ids=[self.id])
36083622
return reward[0]
36093623

0 commit comments

Comments
 (0)