mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
add voice region getting (#1108)
* add voice region getting * clean up this mess * add docstrings * Update VoiceRegion.js * Update RESTMethods.js
This commit is contained in:
committed by
Schuyler Cebulskie
parent
ff92905848
commit
3f4cbd07dd
@@ -322,6 +322,14 @@ class Guild {
|
||||
return this.client.rest.methods.getGuildWebhooks(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch available voice regions
|
||||
* @returns {Collection<string, VoiceRegion>}
|
||||
*/
|
||||
fetchVoiceRegions() {
|
||||
return this.client.rest.methods.fetchVoiceRegions(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a single guild member from a user.
|
||||
* @param {UserResolvable} user The user to fetch the member for
|
||||
|
||||
50
src/structures/VoiceRegion.js
Normal file
50
src/structures/VoiceRegion.js
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Represents a Discord voice region for guilds
|
||||
*/
|
||||
class VoiceRegion {
|
||||
constructor(data) {
|
||||
/**
|
||||
* ID of the region
|
||||
* @type {string}
|
||||
*/
|
||||
this.id = data.id;
|
||||
|
||||
/**
|
||||
* Name of the region
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
|
||||
/**
|
||||
* Whether the region is VIP-only
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.vip = data.vip;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* A sample hostname for what a connection might look like
|
||||
* @type {string}
|
||||
*/
|
||||
this.sampleHostname = data.sample_hostname;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = VoiceRegion;
|
||||
Reference in New Issue
Block a user