diff --git a/discord/events/MessageReactionRemove.ts b/discord/events/MessageReactionRemove.ts index 0323297..f16135c 100644 --- a/discord/events/MessageReactionRemove.ts +++ b/discord/events/MessageReactionRemove.ts @@ -28,11 +28,17 @@ export default class MessageReactionRemove extends DiscordEvent { // Attempt to unpin the message await reaction.message.unpin(); - const channel = reaction.message.channel; - await channel.send(`Unpinned message: ${reaction.message.id}`); + console.log(`Unpinned message: ${reaction.message.id}`); } catch (error) { - const channel = reaction.message.channel; - await channel.send(`Error unpinning message: ${error}`); + try { + const dmChannel = await user.createDM(); + await dmChannel.send({ + content: `There was an error unpinning the message: ${error.message}`, + ephemeral: true, + }); + } catch (dmError) { + console.error(`Failed to send ephemeral error message to ${user.tag}: ${dmError}`); + } } } }