Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/managers/GuildMemberManager.js
Expand Up @@ -2,6 +2,7 @@

const BaseManager = require('./BaseManager');
const { Error, TypeError, RangeError } = require('../errors');
const BaseGuildVoiceChannel = require('../structures/BaseGuildVoiceChannel');
const GuildMember = require('../structures/GuildMember');
const Role = require('../structures/Role');
const Collection = require('../util/Collection');
Expand Down Expand Up @@ -166,7 +167,7 @@ class GuildMemberManager extends BaseManager {
const _data = { ...data };
if (_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');
}
_data.channel_id = _data.channel.id;
Expand Down