Giveaway ends in "active time changes"
Hello, this is my function to show, when giveaways is ends, but its doesnt works, how i can make this? (first
9 Replies
Hi! It would be great if you could provide a bit more information. If I'm understanding correctly, the first picture is what you want to be displayed, and the second is your code? If so, what is being displayed with your current code?
I notice you used
{long: false}
with the ms
function, which might be one of your problems. That will turn the "9 hours, 57 minutes, 20 seconds" you showed into "9h57m20s"Hello, yes. On the first picture show how i want the time show
and second picture is my code
and what i want?
I want automaticly updating time in embed message
like we can see 9 hours, 57 minutes, 20 seconds, but this time automaticly changing in embed
and i dont know how to make it
now, if i type for example 1hour, embed for whole time showing 1 hour
not 55minutes
20minutes
etc.
You should use native discord timestamps (for example, <t:1675011000:R>). You can do this by importing
Formatters
from discord.js, and then:
This will:
- get the user input
- use the ms function to convert it to ms (for example, "1 second" will become 1000)
- create a timestamp by using timestamp syntax (that is: <t:timestamp_in_seconds:R>
(the R is for relative)
Date.now() is the current time, and if we add timeInMs it will be the time the user wants the giveaway to end atnow its show this
i think
its bug
no it's not a bug
embed footers cannot have formatted text
never could have
that's not a footer
I forgot Math.floor
oh
Sorry, I updated the code. You have to surround the
(Date.now() + timeInMs) / 1000)
with Math.floor because Discord only accepts the second count as an integer (Math.floor()
rounds down to the nearest integer)