feat(arabot): add soft mute command

This commit is contained in:
smyalygames 2023-02-10 01:17:52 +00:00
parent 8d1276ab2c
commit fa0d9c2a60

View File

@ -78,12 +78,20 @@ export class SoftMuteCommand extends Command {
return; return;
} }
if (guildMember.roles.cache.has(IDs.roles.restrictions.softMute)) {
await guildMember.roles.remove(IDs.roles.restrictions.softMute);
await interaction.reply({
content: `Removed soft muted for ${user}`,
fetchReply: true,
});
return;
}
await guildMember.roles.add(IDs.roles.restrictions.softMute); await guildMember.roles.add(IDs.roles.restrictions.softMute);
await interaction.reply({ await interaction.reply({
content: `Soft muted ${user}`, content: `Soft muted ${user}`,
fetchReply: true, fetchReply: true,
ephemeral: true,
}); });
} }
@ -98,7 +106,13 @@ export class SoftMuteCommand extends Command {
return; return;
} }
if (user.roles.cache.has(IDs.roles.restrictions.softMute)) {
await user.roles.remove(IDs.roles.restrictions.softMute);
await message.reply(`Removed soft mute for ${user}`);
} else {
await user.roles.add(IDs.roles.restrictions.softMute); await user.roles.add(IDs.roles.restrictions.softMute);
await message.reply(`Soft muted ${user}`);
}
await message.react('✅'); await message.react('✅');
} }