2022-03-19 10:37:45 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const Util = require('../util/Util');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a Discord voice region for guilds.
|
|
|
|
*/
|
|
|
|
class VoiceRegion {
|
|
|
|
constructor(data) {
|
|
|
|
/**
|
|
|
|
* The region's id
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
this.id = data.id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the region
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
this.name = data.name;
|
|
|
|
|
2022-03-24 10:55:32 +00:00
|
|
|
/**
|
|
|
|
* Whether the region is VIP-only
|
|
|
|
* @type {boolean}
|
2022-05-14 08:06:15 +00:00
|
|
|
* @deprecated This property is no longer being sent by the API.
|
2022-03-24 10:55:32 +00:00
|
|
|
*/
|
|
|
|
this.vip = data.vip;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
/**
|
|
|
|
* Whether the region is deprecated
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
this.deprecated = data.deprecated;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the region is optimal
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
this.optimal = data.optimal;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the region is custom
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
this.custom = data.custom;
|
|
|
|
}
|
|
|
|
|
|
|
|
toJSON() {
|
|
|
|
return Util.flatten(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = VoiceRegion;
|