timotejroiko / discord.js-light

All the power of discord.js, zero caching. This library modifies discord.js's internal classes and functions in order to give you full control over its caching behaviour.
Apache License 2.0
292 stars 29 forks source link

account for removal of <guild>.voice #28

Closed anna-rmrf closed 3 years ago

anna-rmrf commented 3 years ago

Since djs dropped the <guild>.voice getter, we need to change this to <guild>.me.voice

timotejroiko commented 3 years ago

since guild.me may be uncached, it may be better to use guild.voiceStates instead, which is what guild.voice did. maybe something like this:

guild.voiceStates.cache.get(client.user.id)?.connection?.disconnect()

or perhaps have guild.me return a member partial if uncached, like guild.owner does in djsl, but that would break things for people who check if guild.me exists

anna-rmrf commented 3 years ago

Yeah better leave guild.me as it is