-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How to gracefully disconnect from a voice channel #13
Comments
additionally
updating the getPlayers endpoint to |
Are you sure you are calling |
Yes, the easiest way for you to reproduce will be to add the following command to your example bot script if (commandName === "disconnect") {
const payload = {
op: 4,
d: {
guild_id: message.guild.id,
channel_id: null,
self_mute: false,
self_deaf: false,
},
};
client.guilds.cache.get(message.guild.id).shard.send(payload);
message.channel.send("Disconnected.");
return;
}
Thanks again |
You should se .connect(null, ...) instead also. |
At present it doesn't allow null connect(voiceId, options, sendPayload) {
if (!voiceId) throw new Error('No voiceId provided.') |
looks like npm is serving an old version
|
I'll update it soon. I recommend to use GH version for now. |
FastLink version
2.4.1-rc.1
Description
this leaves the bot connected to a voice channel
setting channel_id here to null successfully disconnects the bot from the voice channel, however the bot has a 50% chance of blowing up with
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'queue') at update (\node_modules\@performanc\fastlink\index.js:248:29)
when trying to add a song to the queue after creating and connecting the player again. Feels like there is a race condition somewhereHow would you recommend disconnecting the bot from a voice channel? I'm not sure if im missing something obvious
Thank you for your time.
The text was updated successfully, but these errors were encountered: