structures/Stats.js

  1. const Base = require('./Base.js');
  2. /**
  3. * serverlist.space Statistics.
  4. * @extends {Base}
  5. */
  6. class Stats extends Base {
  7. /**
  8. * @param {object} obj
  9. */
  10. constructor(obj) {
  11. super(obj);
  12. /**
  13. * The total number of guilds listed on the site.
  14. * @type {number}
  15. */
  16. this.guilds = obj.servers;
  17. /**
  18. * The total number of users listed on the site.
  19. * @type {number}
  20. */
  21. this.users = obj.users;
  22. /**
  23. * The total number of available tags to choose from.
  24. * @type {number}
  25. */
  26. this.tags = obj.tags;
  27. }
  28. /**
  29. * The total number of guilds and users combined.
  30. * @type {number}
  31. */
  32. get guildUserTotal() {
  33. return this.guilds + this.users;
  34. }
  35. }
  36. module.exports = Stats;