Skip to content

Commit

Permalink
Merge pull request #71 from RandomGuyJCI/multiple-attachment-reaction
Browse files Browse the repository at this point in the history
Fix formatting errors
  • Loading branch information
auburnsummer authored Oct 6, 2024
2 parents 0af649e + 282864f commit 9184759
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 9184759

Please sign in to comment.