Skip to content

Commit ce5efad

Browse files
committed
Update reactions in a separate loop
Embeds are quick to update so they're updated first. Then the slow process of adding reactions begins.
1 parent f01e918 commit ce5efad

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

messageFunctions.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ async def sortEventMessages(bot: OperationBot):
4646

4747
event: Event
4848
for event in EventDatabase.events.values():
49-
try:
50-
messageList = await getEventMessages(event, bot)
51-
except MessageNotFound as e:
52-
raise MessageNotFound(f"sortEventMessages: {e}") from e
49+
messageList = await getEventMessages(event, bot)
5350
await updateMessageEmbeds(messageList, event, bot.eventchannel)
54-
await updateReactions(event, messageList=messageList)
51+
for event in EventDatabase.events.values():
52+
# Updating reactions takes a while, so we do it in a separate task
53+
await updateReactions(event, bot=bot)
5554

5655

5756
async def createEventMessages(event: Event, channel: TextChannel,

0 commit comments

Comments
 (0)