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
|
// 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}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue