From 39b63b6085a9e57473aa9a3d96c526abd6d63940 Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:23:07 +0100 Subject: [PATCH] Actually use the iterator --- discord/ext/commands/core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 8eb32bdb2..cc894cebc 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -265,10 +265,15 @@ async def _convert_stickers( except StopIteration: raise MissingRequiredSticker(param) - for sticker in stickers: + while not stickers.is_empty(): + try: + sticker = next(stickers) + except StopIteration: + raise MissingRequiredSticker(param) + fetched = await sticker.fetch() if isinstance(fetched, sticker_type): - return sticker + return fetched raise MissingRequiredSticker(param)