Closed ghost closed 11 years ago
crickets chirping
Well... on startup. Get the new Date()
and save it in a global variable. Then when requesting the uptime. Do a date comparison (google "javascript date comparison") to get your uptime. That should be enough with Google and trial and error to figure it out. Post your code if you have further questions.
I googled it, but i can't find a simple way to code it
Sometimes things aren't as easy as it seems. Sometimes you can look through other people's bots for a complete method that does the comparison. ;-)
Ok, which bots can I look at to get the coding for bot uptime?
I would start with the bot run by they guy that suggested it. Check out Uglee's code. Mainly the functions.js file. — Sent from Mailbox for iPad
On Sat, Jun 1, 2013 at 8:49 PM, Turntablelover notifications@github.com wrote:
Ok, which bots can I look at to get the coding for bot uptime?
Reply to this email directly or view it on GitHub: https://github.com/alaingilbert/Turntable-API/issues/213#issuecomment-18800410
All of the ones we've previously told you about, except you'll have to figure out if they have an uptime command though.
Mine doesn't. But it has a date comparison for checking idle times of users. — Sent from Mailbox for iPad
On Sat, Jun 1, 2013 at 10:36 PM, DubbyTT notifications@github.com wrote:
All of the ones we've previously told you about, except you'll have to figure out if they have an uptime command though.
Reply to this email directly or view it on GitHub: https://github.com/alaingilbert/Turntable-API/issues/213#issuecomment-18801390
Mine has a sweet uptime command, complete with last downtime and re-login count :) Not open source though.
ok, thanks for the help.
Can you guys help me write up a code that checks the uptime of my bot?