forked from engineering/crv2
Update discord/events/MessageReactionRemove.ts
Switched error messages to ephermal: true Signed-off-by: Harry <harry@harryrosestudios.com>master
parent
65f4bd92dc
commit
54845033f1
|
@ -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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue