bassboost.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. const { MessageEmbed } = require("discord.js");
  2. const { TrackUtils } = require("erela.js");
  3. const levels = {
  4. none: 0.0,
  5. low: 0.2,
  6. medium: 0.3,
  7. high: 0.35,
  8. };
  9. module.exports = {
  10. name: "bassboost",
  11. description: "Enables bass boosting audio effect",
  12. usage: "<none|low|medium|high>",
  13. permissions: {
  14. channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
  15. member: [],
  16. },
  17. aliases: ["bb", "bass"],
  18. /**
  19. *
  20. * @param {import("../structures/DiscordMusicBot")} client
  21. * @param {import("discord.js").Message} message
  22. * @param {string[]} args
  23. * @param {*} param3
  24. */
  25. run: async (client, message, args, { GuildDB }) => {
  26. let player = await client.Manager.get(message.guild.id);
  27. if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
  28. if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**");
  29. //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
  30. if (!args[0]) return client.sendTime(message.channel, "**Please provide a bassboost level. \nAvailable Levels:** `none`, `low`, `medium`, `high`"); //if the user do not provide args [arguments]
  31. let level = "none";
  32. if (args.length && args[0].toLowerCase() in levels) level = args[0].toLowerCase();
  33. player.setEQ(...new Array(3).fill(null).map((_, i) => ({ band: i, gain: levels[level] })));
  34. return client.sendTime(message.channel, `✅ | **Bassboost level set to** \`${level}\``);
  35. },
  36. SlashCommand: {
  37. options: [
  38. {
  39. name: "level",
  40. description: `Please provide a bassboost level. Available Levels: low, medium, high, or none`,
  41. value: "[level]",
  42. type: 3,
  43. required: true,
  44. },
  45. ],
  46. /**
  47. *
  48. * @param {import("../structures/DiscordMusicBot")} client
  49. * @param {import("discord.js").Message} message
  50. * @param {string[]} args
  51. * @param {*} param3
  52. */
  53. run: async (client, interaction, args, { GuildDB }) => {
  54. const levels = {
  55. none: 0.0,
  56. low: 0.2,
  57. medium: 0.3,
  58. high: 0.35,
  59. };
  60. let player = await client.Manager.get(interaction.guild_id);
  61. if (!player) return client.sendTime(interaction, "❌ | **Nothing is playing right now...**");
  62. if (!args) return client.sendTime(interaction, "**Please provide a bassboost level. \nAvailable Levels:** `none`, `low`, `medium`, `high`"); //if the user do not provide args [arguments]
  63. let level = "none";
  64. if (args.length && args[0].value in levels) level = args[0].value;
  65. player.setEQ(...new Array(3).fill(null).map((_, i) => ({ band: i, gain: levels[level] })));
  66. return client.sendTime(interaction, `✅ | **Set the bassboost level to** \`${level}\``);
  67. },
  68. },
  69. };