fix(User): get VoiceState from guild cache
This commit is contained in:
parent
ebdd92240b
commit
609c9acc78
@ -229,7 +229,11 @@ class User extends Base {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get voice() {
|
get voice() {
|
||||||
return this.client.voiceStates.cache.get(this.id) ?? new VoiceState({ client: this.client }, { user_id: this.id });
|
return (
|
||||||
|
this.client.voiceStates.cache.get(this.id) ??
|
||||||
|
this.client.guilds.cache.find(g => g?.voiceStates?.cache?.get(this.id))?.voiceStates?.cache?.get(this.id) ??
|
||||||
|
new VoiceState({ client: this.client }, { user_id: this.id })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ProfilePatch(data) {
|
_ProfilePatch(data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user