fix(GuildMemberManager): allow moving members to any non-text channel (#5681)

This commit is contained in:
Andreas Clausen
2021-06-02 11:57:04 +02:00
committed by GitHub
parent 678b7da5b3
commit d21e6af1d2

View File

@@ -2,6 +2,7 @@
const BaseManager = require('./BaseManager'); const BaseManager = require('./BaseManager');
const { Error, TypeError, RangeError } = require('../errors'); const { Error, TypeError, RangeError } = require('../errors');
const BaseGuildVoiceChannel = require('../structures/BaseGuildVoiceChannel');
const GuildMember = require('../structures/GuildMember'); const GuildMember = require('../structures/GuildMember');
const Role = require('../structures/Role'); const Role = require('../structures/Role');
const Collection = require('../util/Collection'); const Collection = require('../util/Collection');
@@ -166,7 +167,7 @@ class GuildMemberManager extends BaseManager {
const _data = { ...data }; const _data = { ...data };
if (_data.channel) { if (_data.channel) {
_data.channel = this.guild.channels.resolve(_data.channel); _data.channel = this.guild.channels.resolve(_data.channel);
if (!_data.channel || _data.channel.type !== 'voice') { if (!(_data.channel instanceof BaseGuildVoiceChannel)) {
throw new Error('GUILD_VOICE_CHANNEL_RESOLVE'); throw new Error('GUILD_VOICE_CHANNEL_RESOLVE');
} }
_data.channel_id = _data.channel.id; _data.channel_id = _data.channel.id;