fix: invalid channel type

This commit is contained in:
Elysia
2024-10-27 01:54:09 +07:00
parent 9e9ad08123
commit f50aeefc10

View File

@@ -101,7 +101,7 @@ class ClientVoiceManager {
joinChannel(channel, config = {}) {
return new Promise((resolve, reject) => {
channel = this.client.channels.resolve(channel);
if (!['DM', 'GROUP_DM'].includes(channel.type) && !channel.joinable) {
if (!['DM', 'GROUP_DM'].includes(channel?.type) && !channel.joinable) {
throw new Error('VOICE_JOIN_CHANNEL', channel.full);
}