Add config option to make the bot stay in voice chat
This commit is contained in:
parent
5d89d78b44
commit
14046a811a
3 changed files with 23 additions and 13 deletions
|
@ -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.");
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue