buddy

node MVC discord bot
Log | Files | Refs | README

VoiceRegion.js (859B)


      1 'use strict';
      2 
      3 const Util = require('../util/Util');
      4 
      5 /**
      6  * Represents a Discord voice region for guilds.
      7  */
      8 class VoiceRegion {
      9   constructor(data) {
     10     /**
     11      * The ID of the region
     12      * @type {string}
     13      */
     14     this.id = data.id;
     15 
     16     /**
     17      * Name of the region
     18      * @type {string}
     19      */
     20     this.name = data.name;
     21 
     22     /**
     23      * Whether the region is VIP-only
     24      * @type {boolean}
     25      */
     26     this.vip = data.vip;
     27 
     28     /**
     29      * Whether the region is deprecated
     30      * @type {boolean}
     31      */
     32     this.deprecated = data.deprecated;
     33 
     34     /**
     35      * Whether the region is optimal
     36      * @type {boolean}
     37      */
     38     this.optimal = data.optimal;
     39 
     40     /**
     41      * Whether the region is custom
     42      * @type {boolean}
     43      */
     44     this.custom = data.custom;
     45   }
     46 
     47   toJSON() {
     48     return Util.flatten(this);
     49   }
     50 }
     51 
     52 module.exports = VoiceRegion;