fix: Improved user messages for muted audio in /volume

This commit is contained in:
Marius Begby committed 2023-07-15 15:37:54 +02:00
1 parent 7bc50d6a84
commit d5eb032543
1 file changed
+14 -4
+14 -4
View File
@@ -45,11 +45,17 @@ module.exports = {
const volume = interaction.options.getNumber('percentage'); const volume = interaction.options.getNumber('percentage');
if (!volume && volume !== 0) { if (!volume && volume !== 0) {
const currentVolume = queue.node.volume;
return await interaction.editReply({ return await interaction.editReply({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setDescription( .setDescription(
`**${embedIcons.volume} Playback volume**\nThe playback volume is currently set to \`${queue.node.volume}%\`.` `**${
currentVolume === 0
? embedIcons.volumeIsMuted
: embedIcons.volume
} Playback volume**\nThe playback volume is currently set to \`${currentVolume}%\`.`
) )
.setColor(embedColors.colorInfo) .setColor(embedColors.colorInfo)
] ]
@@ -72,11 +78,13 @@ module.exports = {
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setAuthor({ .setAuthor({
name: interaction.member.nickname || interaction.user.username, name:
interaction.member.nickname ||
interaction.user.username,
iconURL: interaction.user.avatarURL() iconURL: interaction.user.avatarURL()
}) })
.setDescription( .setDescription(
`**${embedIcons.volumeChanged} Audio muted**\nPlayback audio has been muted, because volume was set to \`${volume}%\`.` `**${embedIcons.volumeMuted} Audio muted**\nPlayback audio has been muted, because volume was set to \`${volume}%\`.`
) )
.setColor(embedColors.colorSuccess) .setColor(embedColors.colorSuccess)
] ]
@@ -87,7 +95,9 @@ module.exports = {
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setAuthor({ .setAuthor({
name: interaction.member.nickname || interaction.user.username, name:
interaction.member.nickname ||
interaction.user.username,
iconURL: interaction.user.avatarURL() iconURL: interaction.user.avatarURL()
}) })
.setDescription( .setDescription(