-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New] Added 8D audio filter for music
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`)], | ||
}); | ||
} | ||
} | ||
}, | ||
}; |