BlackKnight683

Uptime command

Jan 28th, 2021 (edited)
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $eval
  2. if(typeof now1 === "undefined") {var now1 = new Date();
  3. }
  4. //Run the command as soon as you start the bot :D
  5. var now2
  6. var rightnow = new Date().getTime();
  7. var now = now2 - now1
  8. var now3 = new Date();
  9. var today = new Date(now3.getFullYear(), now3.getMonth(), now1.getDate(), now1.getHours(), now1.getMinutes(), now1.getSeconds()).getTime();
  10.  
  11. var distance = rightnow - today
  12.  
  13. let totalSeconds = (distance / 1000);
  14. let days = Math.floor(totalSeconds / 86400);
  15. let hours = Math.floor(totalSeconds / 3600); totalSeconds %= 3600;
  16. let minutes = Math.floor(totalSeconds / 60);
  17. let seconds = totalSeconds % 60;
  18. var uptime = "\nMy Uptime Stats!\nI Have been running for\n`" + days + "` **Days**" + " `" + hours + "` **Hrs**" + " `" + minutes + "` **Mins**" + " `" + Math.round(seconds) + "` **Seconds**"
  19. $halt $get(uptime)
  20.  
Add Comment
Please, Sign In to add comment