Add config option to make the bot stay in voice chat

This commit is contained in:
Essem 2021-12-11 23:44:49 -06:00
parent 5d89d78b44
commit 14046a811a
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
3 changed files with 23 additions and 13 deletions

View file

@ -5,7 +5,7 @@ import { random } from "../utils/misc.js";
export default async (client, cluster, worker, ipc, member, oldChannel) => {
if (!oldChannel) return;
const connection = players.get(oldChannel.guild.id);
if (connection && connection.type === "music" && oldChannel.id === connection.voiceChannel.id) {
if (connection && oldChannel.id === connection.voiceChannel.id) {
if (oldChannel.voiceMembers.filter((i) => i.id !== client.user.id && !i.bot).length === 0) {
connection.player.pause(true);
const waitMessage = await client.createMessage(connection.originalChannel.id, "🔊 Waiting 10 seconds for someone to return...");
@ -72,4 +72,4 @@ export default async (client, cluster, worker, ipc, member, oldChannel) => {
await client.createMessage(connection.originalChannel.id, "🔊 The current voice channel session has ended.");
}
}
};
};