We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bc2e23 commit a0ff72bCopy full SHA for a0ff72b
src/client/rest/RESTMethods.js
@@ -508,7 +508,11 @@ class RESTMethods {
508
509
updateGuildMember(member, data, reason) {
510
if (data.channel) {
511
- data.channel_id = this.client.resolver.resolveChannel(data.channel).id;
+ const channel = this.client.resolver.resolveChannel(data.channel);
512
+ if (!channel || channel.guild.id !== member.guild.id || channel.type !== 'voice') {
513
+ return Promise.reject(new Error('Could not resolve channel to a guild voice channel.'));
514
+ }
515
+ data.channel_id = channel.id;
516
data.channel = null;
517
}
518
if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
0 commit comments