Methods
# getUsers() → {Array.<User>}
Get all the users associated with this voice connection
An array containing all the User objects
Array.<User>
# isConnected(userId) → {boolean}
Check if a user is connected to this voice channel
Parameters:
Name | Type | Description |
---|---|---|
userId |
string
|
The id of the user |
Wether the user is in the voice channel
boolean
# async play(media) → {void}
Attach a Media object to this connection
Parameters:
Name | Type | Description |
---|---|---|
media |
Media
|
MediaPlayer
|
The media object that should be attached |
void
Example
const connection = voice.getVoiceConnection("someChannelId");
const player = new MediaPlayer();
connection.play(player);
player.playFile("./audio.mp3");