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