forked from engineering/crv2
Update discord/events/MessageReactionAdd.ts
switched error messages to Ephemeral: true Signed-off-by: Harry <harry@harryrosestudios.com>master
parent
e6dae3ae48
commit
65f4bd92dc
|
@ -28,11 +28,17 @@ export default class MessageReactionAdd extends DiscordEvent {
|
|||
|
||||
// Attempt to pin the message
|
||||
await reaction.message.pin();
|
||||
const channel = reaction.message.channel;
|
||||
await channel.send(`Pinned message: ${reaction.message.id}`);
|
||||
console.log(`Pinned message: ${reaction.message.id}`);
|
||||
} catch (error) {
|
||||
const channel = reaction.message.channel;
|
||||
await channel.send(`Error pinning message: ${error}`);
|
||||
try {
|
||||
const dmChannel = await user.createDM();
|
||||
await dmChannel.send({
|
||||
content: `There was an error pinning 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