Skip to content

Commit

Permalink
fix emit
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Jun 29, 2024
1 parent 815e986 commit 1ce3712
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"node-system-stats": "^1.3.0",
"shoukaku": "^4.0.1",
"shoukaku": "github:shipgirlproject/Shoukaku",
"signale": "^1.4.0",
"tslib": "^2.6.3",
"undici": "^6.19.2"
Expand Down
7 changes: 3 additions & 4 deletions src/events/client/VoiceStateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export default class VoiceStateUpdate extends Event {
const vc = newState.guild.channels.cache.get(vcConnection.channelId);
if (!(vc && vc.members instanceof Map)) return;

const is247 = await this.client.db.get_247(guildId);

if (!newState.guild.members.cache.get(this.client.user.id)?.voice.channelId) {
const is247 = await this.client.db.get_247(guildId);
if (!is247 && player) {
return player.destroy();
}
Expand All @@ -39,7 +40,7 @@ export default class VoiceStateUpdate extends Event {
newState.guild.members.me.permissions.has(["Connect", "Speak"]) ||
newState.channel.permissionsFor(newState.guild.members.me).has("MuteMembers")
) {
await newState.guild.members.me.voice.setSuppressed(false).catch(() => {});
await newState.guild.members.me.voice.setSuppressed(false).catch(() => { });
}
}

Expand All @@ -62,8 +63,6 @@ export default class VoiceStateUpdate extends Event {
}

if (vc.members instanceof Map && [...vc.members.values()].filter((x: GuildMember) => !x.user.bot).length <= 0) {
const is247 = await this.client.db.get_247(guildId);

setTimeout(async () => {
const vcConnection = player.node.manager.connections.get(guildId);
if (!vcConnection?.channelId) return;
Expand Down

0 comments on commit 1ce3712

Please sign in to comment.