Skip to content

Commit ba75a7f

Browse files
committed
Update changed methods
1 parent 938d20c commit ba75a7f

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

twitchio/ext/commands/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ async def invoke(self) -> None:
240240
self.bot.dispatch("command_completed")
241241

242242
async def send(self, content: str) -> None:
243-
await self.channel.send_message(sender_id=self.bot.bot_id, message=content)
243+
await self.channel.send_message(sender=self.bot.bot_id, message=content)

twitchio/models/eventsub_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ def get_image(self, size: Literal["1x", "2x", "4x"] = "2x", use_default: bool =
27762776
return Asset(url, http=self._http)
27772777

27782778
async def fetch_reward(self, *, token_for: str) -> CustomReward:
2779-
reward = await self.broadcaster.fetch_custom_rewards(ids=[self.id], token_for=token_for)
2779+
reward = await self.broadcaster.fetch_custom_rewards(ids=[self.id])
27802780
return reward[0]
27812781

27822782

twitchio/models/polls.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,24 @@ def __init__(self, data: PollsResponseData, *, http: HTTPClient) -> None:
113113
def __repr__(self) -> str:
114114
return f"<Poll id={self.id} title={self.title} status={self.status} started_at={self.started_at}>"
115115

116-
async def end_poll(self, *, status: Literal["ARCHIVED", "TERMINATED"], token_for: str | PartialUser) -> Poll:
116+
async def end_poll(self, *, status: Literal["ARCHIVED", "TERMINATED"]) -> Poll:
117117
"""End an active poll.
118118
119+
.. note::
120+
Requires user access token that includes the `channel:manage:polls` scope.
121+
119122
Parameters
120123
----------
121124
status Literal["ARCHIVED", "TERMINATED"]
122125
The status to set the poll to. Possible case-sensitive values are: "ARCHIVED" and "TERMINATED".
123-
token_for: str | PartialUser
124-
User access token that includes the `channel:manage:polls` scope.
125126
126127
Returns
127128
-------
128129
Poll
129130
A Poll object.
130131
"""
131132
data = await self._http.patch_poll(
132-
broadcaster_id=self.broadcaster.id, id=self.id, status=status, token_for=token_for
133+
broadcaster_id=self.broadcaster.id, id=self.id, status=status, token_for=self.broadcaster.id
133134
)
134135
return Poll(data["data"][0], http=self._http)
135136

twitchio/models/predictions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ async def end_prediction(
126126
self,
127127
*,
128128
status: Literal["RESOLVED", "CANCELED", "LOCKED"],
129-
token_for: str | PartialUser,
130129
winning_outcome_id: str | None = None,
131130
) -> Prediction:
132131
"""End an active prediction.
133132
133+
.. note::
134+
Requires user access token that includes the `channel:manage:predictions` scope.
135+
134136
Parameters
135137
----------
136138
status: Literal["RESOLVED", "CANCELED", "LOCKED"]
137139
The status to set the prediction to. Possible case-sensitive values are: `RESOLVED`, `CANCELED`, `LOCKED`
138-
token_for: str | PartialUser
139-
User access token that includes the `channel:manage:predictions` scope.
140140
141141
Returns
142142
-------
@@ -147,7 +147,7 @@ async def end_prediction(
147147
broadcaster_id=self.broadcaster.id,
148148
id=self.id,
149149
status=status,
150-
token_for=token_for,
150+
token_for=self.broadcaster.id,
151151
winning_outcome_id=winning_outcome_id,
152152
)
153153
return Prediction(data["data"][0], http=self._http)

twitchio/models/schedule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def update_segment(
180180
title=title,
181181
canceled=canceled,
182182
timezone=timezone,
183-
token_for=token_for,
183+
token_for=self._broadcaster_id,
184184
)
185185

186186
return Schedule(data["data"], http=self._http)
@@ -199,7 +199,7 @@ async def delete(self, *, token_for: str | PartialUser) -> None:
199199
User access token that includes the ``channel:manage:schedule`` scope.
200200
"""
201201
return await self._http.delete_channel_stream_schedule_segment(
202-
broadcaster_id=self._broadcaster_id, id=self.id, token_for=token_for
202+
broadcaster_id=self._broadcaster_id, id=self.id, token_for=self._broadcaster_id
203203
)
204204

205205

0 commit comments

Comments
 (0)