fix: don't patch set data with undefined (#6694)

This commit is contained in:
Rodry
2021-10-03 13:59:52 +01:00
committed by GitHub
parent 8b4456e0aa
commit 9eb9591473
33 changed files with 1211 additions and 795 deletions

View File

@@ -12,23 +12,29 @@ class BaseGuildVoiceChannel extends GuildChannel {
_patch(data) {
super._patch(data);
/**
* The RTC region for this voice-based channel. This region is automatically selected if `null`.
* @type {?string}
*/
this.rtcRegion = data.rtc_region;
if ('rtc_region' in data) {
/**
* The RTC region for this voice-based channel. This region is automatically selected if `null`.
* @type {?string}
*/
this.rtcRegion = data.rtc_region;
}
/**
* The bitrate of this voice-based channel
* @type {number}
*/
this.bitrate = data.bitrate;
if ('bitrate' in data) {
/**
* The bitrate of this voice-based channel
* @type {number}
*/
this.bitrate = data.bitrate;
}
/**
* The maximum amount of users allowed in this channel.
* @type {number}
*/
this.userLimit = data.user_limit;
if ('user_limit' in data) {
/**
* The maximum amount of users allowed in this channel.
* @type {number}
*/
this.userLimit = data.user_limit;
}
}
/**