Delay sound player leave

This commit is contained in:
Essem 2022-08-26 15:53:38 -05:00
parent 4e3e420875
commit 9fd21495c9
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -3,6 +3,7 @@ import { request } from "undici";
import fs from "fs"; import fs from "fs";
import format from "format-duration"; import format from "format-duration";
import { Shoukaku, Connectors } from "shoukaku"; import { Shoukaku, Connectors } from "shoukaku";
import { setTimeout } from "timers/promises";
export const players = new Map(); export const players = new Map();
export const queues = new Map(); export const queues = new Map();
@ -235,6 +236,7 @@ export async function nextSong(client, options, connection, track, info, music,
// no-op // no-op
} }
} else if (process.env.STAYVC !== "true") { } else if (process.env.STAYVC !== "true") {
await setTimeout(400);
connection.node.leaveChannel(voiceChannel.guild.id); connection.node.leaveChannel(voiceChannel.guild.id);
players.delete(voiceChannel.guild.id); players.delete(voiceChannel.guild.id);
queues.delete(voiceChannel.guild.id); queues.delete(voiceChannel.guild.id);