mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 12:44:17 +02:00
fix(arabot): add checkers if user is in vc when server muting
This commit is contained in:
parent
c735509f57
commit
d7aea2c6c1
@ -85,7 +85,9 @@ export class VCMuteCommand extends Command {
|
||||
// Check if removing VC Mute
|
||||
if (await checkActive(member.id)) {
|
||||
await removeMute(member.id);
|
||||
await member.voice.setMute(false, reason === null ? undefined : reason);
|
||||
if (member.voice.channel !== null) {
|
||||
await member.voice.setMute(false, reason === null ? undefined : reason);
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
content: `Removed server mute from ${user}`,
|
||||
@ -101,7 +103,9 @@ export class VCMuteCommand extends Command {
|
||||
}
|
||||
|
||||
// Add VC Mute
|
||||
await member.voice.setMute(true, reason === null ? undefined : reason);
|
||||
if (member.voice.channel !== null) {
|
||||
await member.voice.setMute(true, reason === null ? undefined : reason);
|
||||
}
|
||||
await addMute(member.id, mod.id, reason);
|
||||
await interaction.reply({
|
||||
content: `Server muted ${user}`,
|
||||
@ -133,7 +137,9 @@ export class VCMuteCommand extends Command {
|
||||
// Check if removing VC Mute
|
||||
if (await checkActive(member.id)) {
|
||||
await removeMute(member.id);
|
||||
await member.voice.setMute(false, reason === null ? undefined : reason);
|
||||
if (member.voice.channel !== null) {
|
||||
await member.voice.setMute(false, reason === null ? undefined : reason);
|
||||
}
|
||||
|
||||
await message.reply(`Removed server mute from ${member}`);
|
||||
await message.react('✅');
|
||||
@ -146,7 +152,9 @@ export class VCMuteCommand extends Command {
|
||||
}
|
||||
|
||||
// Add VC Mute
|
||||
await member.voice.setMute(true, reason === null ? undefined : reason);
|
||||
if (member.voice.channel !== null) {
|
||||
await member.voice.setMute(true, reason === null ? undefined : reason);
|
||||
}
|
||||
await addMute(member.id, mod.id, reason);
|
||||
await message.reply(`Server muted ${member}`);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user