diff options
-rw-r--r-- | bot/exts/help_channels/_message.py | 2 | ||||
-rw-r--r-- | bot/exts/recruitment/talentpool/_review.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py index 7ceed9b4d..f4c3a6fd7 100644 --- a/bot/exts/help_channels/_message.py +++ b/bot/exts/help_channels/_message.py @@ -68,7 +68,7 @@ async def get_last_message(channel: discord.TextChannel) -> t.Optional[discord.M try: return await channel.history(limit=1).next() # noqa: B305 - except discord.NoMoreItems: + except StopAsyncIteration: log.debug(f"No last message available; #{channel} ({channel.id}) has no messages.") return None diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py index 214d85851..d0edf5388 100644 --- a/bot/exts/recruitment/talentpool/_review.py +++ b/bot/exts/recruitment/talentpool/_review.py @@ -11,7 +11,7 @@ from typing import List, Optional, Union import arrow from botcore.utils.scheduling import Scheduler from dateutil.parser import isoparse -from discord import Embed, Emoji, Member, Message, NoMoreItems, NotFound, PartialMessage, TextChannel +from discord import Embed, Emoji, Member, Message, NotFound, PartialMessage, TextChannel from discord.ext.commands import Context from bot.api import ResponseCodeError @@ -151,7 +151,7 @@ class Reviewer: # We consider the first message in the nomination to contain the user ping, username#discrim, and fixed text messages = [message] if not NOMINATION_MESSAGE_REGEX.search(message.content): - with contextlib.suppress(NoMoreItems): + with contextlib.suppress(StopAsyncIteration): async for new_message in message.channel.history(before=message.created_at): messages.append(new_message) |