BilliAlpha / discord-transfer

A discord bot for copying messages between guilds
26 stars 0 forks source link

Crash when trying to migrate a message with the maximum number of reactions #18

Closed IronPegasus closed 1 year ago

IronPegasus commented 1 year ago

When the bot is migrating a channel and tries to process a message that already has the maximum number of reactions (20 unique emotes) added to it, it crashes with the following error message:

2023-01-27 12:49:19 WARN  com.billialpha.discord.transfer.DiscordTransfer - Error in channel migration
discord4j.rest.http.client.ClientException: PUT /channels/353359965081305088/messages/356953624934613002/reactions/%F0%9F%94%84/@me returned 403 Forbidden with response {code=30010, message=Maximum number of reactions reached (20)}
        at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
        Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Example message from my server: image

I'd probably expect the bot to write a warning message to the log and just skip adding the "processed" reaction to this particular message.

BilliAlpha commented 1 year ago

You're right, this shouldn't crash the entire migration. I'll try to get a fix out soon. If you feel like opening a PR please do!

BilliAlpha commented 1 year ago

Fixed in new release: v2.2.2

IronPegasus commented 1 year ago

Thank you so much!