diff --git a/src/logs/channel_logs.py b/src/logs/channel_logs.py index 944a0f7..f71b61b 100644 --- a/src/logs/channel_logs.py +++ b/src/logs/channel_logs.py @@ -66,8 +66,8 @@ class ChannelLogs: is_empty = self.last_message_id is None try: if is_empty: - sanity_check = len(await channel.history(limit=1).flatten()) - if sanity_check != 1: + sanity_check = len([message async for message in channel.history(limit=1)]) + if sanity_check < 1: yield len(self.messages), True return # load backward diff --git a/src/utils/utils.py b/src/utils/utils.py index 9a67b2e..fb27b8c 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -116,7 +116,7 @@ def escape_text(text: str) -> str: return discord.utils.escape_markdown(discord.utils.escape_mentions(text)) -class FakeMessage: +class FakeMessage(discord.abc.Snowflake): def __init__(self, id: int): self.id = id