Discord Bot Maker

Discord Bot Maker

View Stats:
Souretsu Jan 1, 2019 @ 5:44pm
Need assistance with a hidden countdown timer
Hi, I've been working on making a bot with this software, and it's been super helpful, especially given how it's been years since I've really touched any programming, but I'm kind of stuck.

My desired end result is this: I want certain actions and commands to change my bot's Game to specific things. However, after a certain amount of time expires (we'll say 5 minutes), if nothing else has triggered a change or reset on the bot's status, I want it to reset to default.

I've spent some time looking and from what I can figure I need to use an Event for the timer and I can use commands to change the game status obviously. But I'm having trouble figuring out how to get the timer to count down and would really appreciate if someone could nudge me in the right direction.
< >
Showing 1-1 of 1 comments
9PoundHammer Jan 8, 2019 @ 2:05am 
Maybe store each action/command to hold a place holder variable(on/off). anouther command reseting the on/off or the command/event end itself with a reset on/off.

for the timer you would need to store server info such as day, hour, min. you could easily set them by a command with 3 parameter check(!settimer 5 3 0=5 Days 3 Hours) which takes today current day adds 5, then 3 hours to current hour. store that serverVar for call functions. convert to a usuable number to add to wait function.

call countdown would pull todays day, hour, min. does the math from settimer difference from countdown call giving you the time remaining.

there is obviously a lot more math in between for calculating the time remaining. like convert the settimer to a useable value like say seconds then back to minutes/hours for the reamining call, but that all comes down to what you feel is the easiest method. hopefully this points you in the semi right direction.
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: Jan 1, 2019 @ 5:44pm
Posts: 1