Advertisement
Earthcomputer

channels.js

Aug 4th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var texts = guild.getTextChannels().length;
  2. var voices = guild.getVoiceChannels().length;
  3.  
  4. var now = new Date();
  5. var days_in_year = 0;
  6. for (var i = 0; i < now.getMonth(); i++)
  7.     days_in_year += [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][i];
  8. days_in_year += now.getDate();
  9. var days_left = 366 - days_in_year;
  10.  
  11. var channel_creation_rate = 1 / (Math.random() * 50 + 25);
  12. var expected = (texts + voices) + days_left * channel_creation_rate;
  13. expected = Math.round(expected);
  14.  
  15. var message = "There are "
  16. + (texts + voices)
  17. + " channels on Earth's Place so far! ("
  18. + texts
  19. + " text channels and "
  20. + voices
  21. + " voice channels)\nI am expecting "
  22. + expected
  23. + " by the end of the year.";
  24. channel.message(message);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement