feat(VoiceState): add methods for fetching voice state

#10442 backport
This commit is contained in:
Elysia
2024-09-17 19:25:19 +07:00
parent 8dfa37fbd9
commit 5a0910a4f9
3 changed files with 33 additions and 0 deletions

View File

@@ -328,6 +328,15 @@ class VoiceState extends Base {
});
}
/**
* Fetches this voice state.
* @param {boolean} [force=true] Whether to skip the cache check and request the API
* @returns {Promise<VoiceState>}
*/
fetch(force = true) {
return this.guild?.voiceStates?.fetch(this.id, { force });
}
toJSON() {
return super.toJSON({
id: true,