mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
fix(GuildMemberManager): allow moving members to any non-text channel (#5681)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user