File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1363,9 +1363,13 @@ def _get_retrieve(self) -> bool:
1363
1363
return self .retrieve > 0
1364
1364
1365
1365
async def fill_messages (self ) -> None :
1366
+ if self .channel_id is None or self .channel is None :
1367
+ # should never happen
1368
+ raise RuntimeError ("The library has a bug. Contact a maintainer!" )
1369
+
1366
1370
if self ._get_retrieve ():
1367
1371
data = await self .getter (
1368
- channel_id = self .channel_id , # type: ignore
1372
+ channel_id = self .channel_id ,
1369
1373
before = self .before ,
1370
1374
limit = self .retrieve ,
1371
1375
)
@@ -1381,6 +1385,6 @@ async def fill_messages(self) -> None:
1381
1385
self .limit = 0 # terminate loop
1382
1386
1383
1387
for element in data ["items" ]:
1384
- message = self ._state .create_message (channel = self .channel , data = element ["message" ]) # type: ignore
1388
+ message = self ._state .create_message (channel = self .channel , data = element ["message" ])
1385
1389
message ._handle_pinned_timestamp (element ["pinned_at" ])
1386
1390
await self .messages .put (message )
You can’t perform that action at this time.
0 commit comments