Update discord/events/MessageReactionRemove.ts

Switched error messages to ephermal: true

Signed-off-by: Harry <harry@harryrosestudios.com>
pull/1/head
Harry 2024-12-20 20:34:31 -05:00
parent 65f4bd92dc
commit 54845033f1
1 changed files with 10 additions and 4 deletions

View File

@ -28,11 +28,17 @@ export default class MessageReactionRemove extends DiscordEvent {
// Attempt to unpin the message // Attempt to unpin the message
await reaction.message.unpin(); await reaction.message.unpin();
const channel = reaction.message.channel; console.log(`Unpinned message: ${reaction.message.id}`);
await channel.send(`Unpinned message: ${reaction.message.id}`);
} catch (error) { } catch (error) {
const channel = reaction.message.channel; try {
await channel.send(`Error unpinning message: ${error}`); 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}`);
}
} }
} }
} }