Browse Source

Actually use the iterator

pull/10021/head
Soheab_ 5 months ago
parent
commit
39b63b6085
  1. 9
      discord/ext/commands/core.py

9
discord/ext/commands/core.py

@ -265,10 +265,15 @@ async def _convert_stickers(
except StopIteration: except StopIteration:
raise MissingRequiredSticker(param) 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() fetched = await sticker.fetch()
if isinstance(fetched, sticker_type): if isinstance(fetched, sticker_type):
return sticker return fetched
raise MissingRequiredSticker(param) raise MissingRequiredSticker(param)

Loading…
Cancel
Save