From 156cdd4918fe150fa56f845ee2c6ba67ecd351a6 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sat, 16 Jul 2022 00:50:27 +0700 Subject: [PATCH] feat(VoiceState): add user prop. --- package-lock.json | 4 ++-- package.json | 2 +- src/structures/VoiceState.js | 9 +++++++++ typings/index.d.ts | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 12f17ba..be5b926 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord.js-selfbot-v13", - "version": "2.3.76", + "version": "2.3.77", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "discord.js-selfbot-v13", - "version": "2.3.76", + "version": "2.3.77", "license": "GNU General Public License v3.0", "dependencies": { "@aikochan2k6/qrcode-terminal": "^0.12.0", diff --git a/package.json b/package.json index 949f269..c191f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js-selfbot-v13", - "version": "2.3.76", + "version": "2.3.77", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "main": "./src/index.js", "types": "./typings/index.d.ts", diff --git a/src/structures/VoiceState.js b/src/structures/VoiceState.js index de49b81..f952946 100644 --- a/src/structures/VoiceState.js +++ b/src/structures/VoiceState.js @@ -136,6 +136,15 @@ class VoiceState extends Base { return this.guild.members.cache.get(this.id) ?? null; } + /** + * The user that this voice state belongs to + * @type {?User} + * @readonly + */ + get user() { + return this.guild.client.users.cache.get(this.id) ?? null; + } + /** * The channel that the member is connected to * @type {?(VoiceChannel|StageChannel)} diff --git a/typings/index.d.ts b/typings/index.d.ts index c623cba..3e4374e 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3041,7 +3041,7 @@ export class VoiceState extends Base { public selfVideo: boolean | null; public suppress: boolean; public requestToSpeakTimestamp: number | null; - + public readonly user: User | null; public setDeaf(deaf?: boolean, reason?: string): Promise; public setMute(mute?: boolean, reason?: string): Promise; public disconnect(reason?: string): Promise;