Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting errors #71

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions orchard/scan/sources/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def get_iids(self):
current_after = int(post["id"])

# check the post does not have a :no-entry-sign: by the OP.
remove_attachments = check_reactions(post, "🚫"):
remove_attachments = await self.check_reaction(post, "🚫")

# a message can only have a maximum of 10 attachments, so we use number reactions
number_reactions = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
Expand All @@ -148,7 +148,7 @@ async def get_iids(self):
attachment_numbers = []
for i, attachment in enumerate(post["attachments"]):
if attachment["filename"].endswith(".rdzip"):
if remove_attachments and check_reaction(post, number_reactions[i]):
if remove_attachments and await self.check_reaction(post, number_reactions[i]):
ignore_all_attachments = False
continue
attachment_numbers.append(i)
Expand All @@ -160,7 +160,7 @@ async def get_iids(self):
# note: the channel id is not required because channels are immutable by source id.
# note2: attachment id is required because it's possible to delete an attachment
# w/o deleting the post.
iid = f"{post['id']}|{post["attachments"][i]['id']}"
iid = f"{post['id']}|{post['attachments'][i]['id']}"
# cache of message objects for later use, if needed.
self.iid_cache[iid] = post
iids.append(iid)
Expand Down
Loading