Set slash command only visible by user
Im new to this and idk how to set a slash command to be only visible by the one doing it
5 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
else {
const expirationTime = timestamps.get(interaction.user.id) + cooldownAmount;
const timeLeft = (expirationTime - now) / 1000;
if (now < expirationTime && timeLeft > 0.9) {
return interaction.reply({ content:
⏰ Wait **\
${timeLeft.toFixed(1)}` seconds to use the ${command.name}** command again!`, ephemeral: true });
}
timestamps.set(interaction.user.id, now);
setTimeout(() => timestamps.delete(interaction.user.id), cooldownAmount);
i want a wait message to be only visible by the user doing the command again
though of adding ephemeral: true }); but didnt workEphemeral does that
i get a error doing that
Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred.
Try interaction.deferReply