Skip to content

Commit 99644ad

Browse files
committed
avoid type ignores where possible
1 parent 5dffc57 commit 99644ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

disnake/iterators.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,13 @@ def _get_retrieve(self) -> bool:
13631363
return self.retrieve > 0
13641364

13651365
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+
13661370
if self._get_retrieve():
13671371
data = await self.getter(
1368-
channel_id=self.channel_id, # type: ignore
1372+
channel_id=self.channel_id,
13691373
before=self.before,
13701374
limit=self.retrieve,
13711375
)
@@ -1381,6 +1385,6 @@ async def fill_messages(self) -> None:
13811385
self.limit = 0 # terminate loop
13821386

13831387
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"])
13851389
message._handle_pinned_timestamp(element["pinned_at"])
13861390
await self.messages.put(message)

0 commit comments

Comments
 (0)