Delete ping and not ping.
Need a little help, im making a slots bot and it allows the slot user to ping once per hour, and if not then it deletes the ping and returns a message, although to other users the person still pinged as discord shows the ping even know the message was deleted, is there any other way to do that?
2 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP-- [email protected]
node -v version?
v20.12.2
```js
if (!isAdmin && userMentionHistory[userId]) {
const lastMentionTime = userMentionHistory[userId].lastMention;
if (now - lastMentionTime < oneDay) {
const timeLeft = oneDay - (now - lastMentionTime);
const hoursLeft = Math.floor(timeLeft / (1000 * 60 * 60));
const minutesLeft = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
const response =
You can use everyone or here again in ${hoursLeft} hours and ${minutesLeft} minutes.`;
await message.delete(); await message.channel.send(response); return; } }``` sortefd