Skip to content

Commit

Permalink
fix sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
Klemek committed Sep 2, 2022
1 parent d8e9e48 commit cb37b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/logs/channel_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async def load(
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
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cb37b05

Please sign in to comment.