1
- from typing import TYPE_CHECKING , cast
1
+ from typing import TYPE_CHECKING , cast , TypedDict
2
2
3
3
import discord_typings
4
4
14
14
from interactions import UPLOADABLE_TYPE
15
15
16
16
17
+ class GetAnswerVotersData (TypedDict ):
18
+ users : list [discord_typings .UserData ]
19
+
20
+
17
21
class MessageRequests (CanRequest ):
18
22
async def create_message (
19
23
self ,
@@ -184,7 +188,7 @@ async def get_answer_voters(
184
188
answer_id : int ,
185
189
after : "Snowflake_Type | None" = None ,
186
190
limit : int = 25 ,
187
- ) -> list [ discord_typings . UserData ] :
191
+ ) -> GetAnswerVotersData :
188
192
"""
189
193
Get a list of users that voted for this specific answer.
190
194
@@ -196,20 +200,20 @@ async def get_answer_voters(
196
200
limit: The max number of users to return (default 25, max 100)
197
201
198
202
Returns:
199
- list[discord_typings.UserData] : A list of users that voted for the answer
203
+ GetAnswerVotersData : A response that has a list of users that voted for the answer
200
204
201
205
"""
202
206
result = await self .request (
203
207
Route (
204
208
"GET" ,
205
- "/channels/{channel_id}/messages /{message_id}/polls /{answer_id}/votes " ,
209
+ "/channels/{channel_id}/polls /{message_id}/answers /{answer_id}" ,
206
210
channel_id = channel_id ,
207
211
message_id = message_id ,
208
212
answer_id = answer_id ,
209
213
),
210
214
params = dict_filter_none ({"after" : after , "limit" : limit }),
211
215
)
212
- return cast (list [ discord_typings . UserData ] , result )
216
+ return cast (GetAnswerVotersData , result )
213
217
214
218
async def end_poll (self , channel_id : "Snowflake_Type" , message_id : "Snowflake_Type" ) -> discord_typings .MessageData :
215
219
"""
@@ -226,7 +230,7 @@ async def end_poll(self, channel_id: "Snowflake_Type", message_id: "Snowflake_Ty
226
230
result = await self .request (
227
231
Route (
228
232
"POST" ,
229
- "/channels/{channel_id}/messages /{message_id}/polls/end " ,
233
+ "/channels/{channel_id}/polls /{message_id}/expire " ,
230
234
channel_id = channel_id ,
231
235
message_id = message_id ,
232
236
)
0 commit comments