fix: Exception thrown when attempting to get VoiceState channel

#1558
This commit is contained in:
Elysia
2025-04-25 13:55:27 +07:00
parent 35186568a7
commit 3d90afd3e5

View File

@@ -152,7 +152,7 @@ class VoiceState extends Base {
* @readonly
*/
get channel() {
return (this.guild || this.client).channels.cache.get(this.channelId) ?? null;
return (this.guild?.id ? this.guild : this.client)?.channels?.cache.get(this.channelId) ?? null;
}
/**