Skip to content

Commit

Permalink
[New] Added 8D audio filter for music
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Oct 1, 2021
1 parent 588c3c2 commit 8465c96
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions commands/music/8D.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");

module.exports = {
data: new SlashCommandBuilder()
.setName("8d")
.setDescription("8D Audio Filter")
.addStringOption((option) =>
option
.setName("mode")
.setDescription("ON/OFF")
.setRequired(true)
.addChoice("ON", "1")
.addChoice("OFF", "0")
),

async execute(interaction, client) {
await interaction.deferReply();
const queue = client.player.getQueue(interaction.guild);
const mode = interaction.options.getString("mode");

if (!queue)
return await interaction.followUp({
embeds: [
embedMessage(
"#9dcc37",
`Your Queue is empty, Make sure to play a song first`
),
],
});

switch (mode) {
case "1":
try {
await queue.setFilters({
"8D": true,
});
await interaction.followUp({
embeds: [embedMessage("#9dcc37", `✅ 8D Filter has been enabled`)],
});
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp({
embeds: [embedMessage("#9dcc37", `Could not set the Filter`)],
});
}
break;
case "0":
try {
await queue.setFilters({ "8D": false });
await interaction.followUp({
embeds: [embedMessage("#9dcc37", `✅ 8D Filter has been disabled`)],
});
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp({
embeds: [embedMessage("#9dcc37", `Could not disable the filter`)],
});
}
}
},
};

0 comments on commit 8465c96

Please sign in to comment.