diff --git a/README.md b/README.md index f123709..34f7b4a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

Green-bot

If you liked this repository, feel free to leave a star ⭐ , it supports us a lot! Thanks you!

-

Green-bot is a Free Discord Music bot who support Youtube, Spotify, Soundcloud, Vimeo, Facebook and 700 + websites. - many more

+

Green-bot is a Free Discord Music bot who supports EpidemicSounds, Freesounds and http links! +


@@ -53,35 +53,50 @@ + 24/7 music
+ Songs request channel
+ Highly configurable
-+ YouTube and YouTube Music
-+ Spotify & Soundcloud
+ Remove duplicates tracks
+ Easy to setup

**📁 Installation** -Note: If you need help with the installation, you can join our [Discord Server](https://green-bot.app/discord). +Note: If you need help with the installation, you can join our [Discord Server]([https://green-bot.app/discord](https://discord.gg/Q5QSbAHaXB)). + +And yes, it's same for replit. You are looking for the All-in-One bot? [Click here](https://github.com/GreenBotDeveloppement/Green-bot/tree/multipropose) Before starting, make you sure you have a mongoDB database (it's free) and nodejs v16. +You will need to start a lavalink server and complete the informations in the config.js files. + +[Guide: How to start and create a lavalink server](https://dsharpplus.github.io/articles/audio/lavalink/setup.html) + +Once your server is ready go in the `config.js` file and add a node. + +```js +lavalink: [ + { name: "node", url: "IP:PORT", auth: "LAVALINK_PASSWORD" }, + ], +``` + +⚠ Please make sure that you are using the same informations as provided in the `application.yml` file + __Step 1.__ Install NodeJS on your computer or on your vps. https://nodejs.org. You MUST have NodeJs 16 or an higher version. Then, download the files and open them with Visual Studio code (code.visualstudio.com). Then press `Crtl + shift + ù` or click on "new terminal", on the top bar. __Step 2.__ -When your terminal is created, write `npm i` in your terminal to download the modules. -If you encounter an error, make you sure that you have the latest version of nodejs. +When your terminal is created, write `npm install` in your terminal to download all the modules. +⚠ the bot won't work if this doesnt works +If you encounter any error, make you sure that you have the latest version of nodejs or ask in the discord server. __Step 3.__ When the modules have been downloaded and a `node-modules` directory has been created, go to the `config.js` file and setup the bot. You can find some comments about every setting. __Step 4.__ -Now, you can start the bot by pressing `F5` or putting `node sharder.js` in the terminal. +Now, you can start the bot by pressing `F5` or putting `node index.js` in the terminal. __Step 5.__ Enjoy your bot ! diff --git a/base/GreenBot.js b/base/GreenBot.js deleted file mode 100644 index e875cec..0000000 --- a/base/GreenBot.js +++ /dev/null @@ -1,27 +0,0 @@ -const { createClientVars } = require("../util/functions") -const { Player } = require("discord-player"); -const util = require("util") -const { Client, Collection } = require("discord.js") -class GreenBot extends Client { - constructor(options) { - super(options); - createClientVars(this); - this.player = new Player(this, { - leaveOnEnd: !1, - leaveOnStop: !0, - leaveOnEmpty: !0, - enableLive: !0, - ytdlDownloadOptions: { - quality: 'highest', - filter: 'audioonly', - }, - timeout: 0, - volume: 65, - quality: "high" - }); - this.wait = util.promisify(setTimeout) - this.queue = new Map() - this.commands = new Collection() - } -} -module.exports = GreenBot; \ No newline at end of file diff --git a/commands/configuration/247.js b/commands/configuration/247.js deleted file mode 100644 index 05c4b09..0000000 --- a/commands/configuration/247.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - name: '24/7', - description: 'Enable/Disable The 24h/7 mode', - cat: 'configuration', - exemple: 'on', - premium: true, - permissions: ["MANAGE_GUILD"], - aliases: ['247'], - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const lang = await message.translate("24/7", guildDB.lang) - if (!guildDB.h24) { - guildDB.h24 = true; - guildDB.save(); - message.succesMessage(lang.enabled, true); - } else { - guildDB.h24 = null; - guildDB.save(); - message.succesMessage(lang.disabled, true); - }; - }, -}; diff --git a/commands/configuration/announce.js b/commands/configuration/announce.js deleted file mode 100644 index 8efa69d..0000000 --- a/commands/configuration/announce.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - name: 'toggle-np', - description: 'This will enable/disable now-playing aka song announcing', - cat: 'configuration', - exemple: 'enable', - Rpremium: true, - aliases: ['announcesongs', "announce"], - permissions: ["MANAGE_GUILD"], - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB, cmd) { - const lang = await message.translate("ANNOUNCE", guildDB.lang) - if (!guildDB.announce) { - guildDB.announce = true - guildDB.save() - return message.succesMessage(lang.enabled); - } else { - guildDB.announce = null - guildDB.save() - return message.succesMessage(lang.disabled); - }; - }, -}; \ No newline at end of file diff --git a/commands/configuration/auto-shuffle.js b/commands/configuration/auto-shuffle.js deleted file mode 100644 index 941900f..0000000 --- a/commands/configuration/auto-shuffle.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = { - name: 'autoshuffle', - description: 'If you want to shuffle automatically spotify/youtube playlists', - cat: 'configuration', - exemple: 'enable', - premium: true, - args: true, - permissions: ["MANAGE_GUILD"], - usages: ["autoshuffle enable", "autoshuffle disable"], - aliases: ['autoshuffle'], - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB, cmd) { - const lang = await message.translate("autoshuffle", guildDB.lang) - if (args.join(" ").toLowerCase() === 'enable') { - if (!guildDB.auto_shuffle) { - guildDB.auto_shuffle = true; - guildDB.save(); - message.succesMessage(lang.enabled); - if (client.player.getQueue(message.guild.id)) client.player.getQueue(message.guild.id).metadata.guildDB.auto_shuffle = true - } else { - return message.errorMessage(lang.enabledSince); - }; - } else if (args.join(" ").toLowerCase() === 'disable') { - if (guildDB.auto_shuffle) { - guildDB.auto_shuffle = null; - guildDB.save(); - message.succesMessage(lang.disabled); - if (client.player.getQueue(message.guild.id)) client.player.getQueue(message.guild.id).metadata.guildDB.auto_shuffle = null - } else { - return message.errorMessage(lang.disabledSince); - }; - } else { - return message.usage(guildDB, cmd) - - } - }, -}; \ No newline at end of file diff --git a/commands/configuration/autoplay.js b/commands/configuration/autoplay.js deleted file mode 100644 index 47e9dfd..0000000 --- a/commands/configuration/autoplay.js +++ /dev/null @@ -1,42 +0,0 @@ -const { QueueRepeatMode } = require("discord-player"); -module.exports = { - name: 'autoplay', - description: 'Enables or disables the autoplay system. If enabled, the bot will play songs like the songs that you listen', - cat: 'configuration', - exemple: 'enable', - premium: true, - aliases: ['ap'], - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("AUTOPLAYE", guildDB.lang) - if (queue.repeatMode == QueueRepeatMode.AUTOPLAY) { - queue.setRepeatMode(QueueRepeatMode.OFF); - return message.succesMessage(lang.disabled, true); - } else { - queue.setRepeatMode(QueueRepeatMode.AUTOPLAY); - return message.succesMessage(lang.enabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/configuration/controller.js b/commands/configuration/controller.js deleted file mode 100644 index 00ce2bc..0000000 --- a/commands/configuration/controller.js +++ /dev/null @@ -1,131 +0,0 @@ -const Discord = require("discord.js") -module.exports = { - name: 'controller', - description: 'Sets the controller channel', - cat: 'configuration', - usage: '#channel/disable', - usages: ["controller #channel", "controller disable"], - exemple: '#channel', - permissions: ['MANAGE_GUILD'], - botpermissions: ['MANAGE_CHANNELS', "MANAGE_MESSAGES"], - async execute(message, args, client, guildDB) { - const lang = await message.translate("CONTROLLER", guildDB.lang) - if (args[0] && args[0].toLowerCase() === 'disable') { - if (guildDB.requestChannel) { - message.guild.channels.cache.get(guildDB.requestChannel) ? message.guild.channels.cache.get(guildDB.requestChannel).delete() : "" - guildDB.requestChannel = null - guildDB.save() - return message.succesMessage(lang.disable) - } else { - let required = await message.translate("CONGIG_REQUIRED", guildDB.lang) - return message.errorMessage(required) - } - } - if (guildDB.requestChannel && message.guild.channels.cache.get(guildDB.requestChannel)) { - return message.errorMessage(lang.already.replace("{channel}", `<#${guildDB.requestChannel}>`)) - } - let channel = message.mentions.channels.first(); - if (!channel) channel = await message.guild.channels.create(`green songs request`, { type: "GUILD_TEXT", }).catch(err => message.errorMessage("Please give me the `Manage channels` permissions to create a controller.")) - if (!channel || channel.guild.id !== message.guild.id) { - let errorChannel = await message.translate("ERROR_CHANNEL", guildDB.lang) - return message.errorMessage(errorChannel) - } - if (!channel.permissionsFor(message.guild.me).has('SEND_MESSAGES') || !channel.permissionsFor(message.guild.me).has('EMBED_LINKS') || !channel.viewable) { - let a = await message.translate("CHANNEL_PERMS", guildDB.lang) - return message.errorMessage(a) - } - guildDB.requestChannel = channel.id - const embed = new Discord.MessageEmbed() - .setAuthor(message.guild.name, message.guild.icon ? message.guild.iconURL({ dynamic: true }) : "https://cdn.discordapp.com/attachments/748897191879245834/782271474450825226/0.png?size=128", client.config.links.invite) - .setDescription(`Send a music name/link bellow this message to play music.\n[Invite me](${client.config.links.invite}) | [Dashboard](${client.config.links.website}) | [Commands]${client.config.links.website}/commands)`) - .addField("Now playing", "__**Nothing playing**__") - .setImage(url = "https://cdn.discordapp.com/attachments/893185846876975104/900453806549127229/green_bot_banner.png") - .setFooter(`${message.client.footer}`, message.client.user.displayAvatarURL({ dynamic: true, size: 512 })) - .setColor("#3A871F") - const msg = await channel.send({ - embeds: [embed], - components: [{ - components: [{ - customId: 'back_button', - emoji: '⏮️', - style: 2, - type: 'BUTTON' - }, - { - customId: 'seek_back_button', - emoji: '⏪', - style: 2, - type: 'BUTTON' - }, - { - customId: 'autoplay', - emoji: '🎧', - style: 2, - type: 'BUTTON' - }, - { - customId: 'seek_button', - emoji: '⏩', - style: 2, - type: 'BUTTON' - }, - { - customId: 'next', - emoji: '⏭️', - style: 2, - type: 'BUTTON' - }, - - ], - type: 'ACTION_ROW' - }, - { - components: [{ - customId: 'pause', - emoji: '⏸', - style: 2, - type: 'BUTTON' - }, - { - customId: 'resume', - emoji: '▶', - style: 2, - type: 'BUTTON' - }, - - { - customId: 'stop', - emoji: '⏹', - style: 2, - type: 'BUTTON' - }, - { - customId: 'shuffle', - emoji: '🔀', - style: 2, - type: 'BUTTON' - }, - { - customId: 'loop', - emoji: '🔄', - style: 2, - type: 'BUTTON' - }, - - ], - type: 'ACTION_ROW' - } - ], - - }) - guildDB.requestChannel = channel.id; - guildDB.requestMessage = msg.id; - guildDB.save() - const embede = new Discord.MessageEmbed() - .setAuthor(message.author.username, message.member.user.displayAvatarURL(), client.config.links.invite) - .setDescription(lang.succes.replace("{channel}", channel)) - .setFooter(`${message.client.footer}`, message.client.user.displayAvatarURL({ dynamic: true, size: 512 })) - .setColor("#3A871F") - message.channel.send({ embeds: [embede] }) - }, -}; \ No newline at end of file diff --git a/commands/configuration/defaultVolume.js b/commands/configuration/defaultVolume.js deleted file mode 100644 index 454e57c..0000000 --- a/commands/configuration/defaultVolume.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = { - name: 'defaultVolume', - description: 'Sets the default volume', - permissions: false, - aliases: ['defaultvolume'], - cat: 'configuration', - args: true, - usage: '', - premium: true, - exemple: '70', - permissions: ["MANAGE_GUILD"], - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - let volume = args[0]; - if (isNaN(volume) || 200 < parseInt(volume) || parseInt(volume) <= 0) { - let numberErr = await message.translate("NUMBER_ERROR", guildDB.lang) - return message.errorMessage(numberErr.replace("{amount}", "1").replace("{range}", "200")) - } - if (message.content.includes('-') || message.content.includes('+') || message.content.includes(',') || message.content.includes('.')) { - let numberErr = await message.translate("NUMBER_ERROR", guildDB.lang) - return message.errorMessage(numberErr.replace("{amount}", "1").replace("{range}", "200")) - } - guildDB.defaultVolume = volume; - guildDB.save() - let a = await message.translate("DEFAULT_VOLUME", guildDB.lang) - message.succesMessage(a.replace("{volume}", volume)) - if (volume < 20) { - let a = await message.translate("DEFAULT_VOLUME_WARNING", guildDB.lang) - message.mainMessage(a.replace("{volume}", volume)) - } - }, -}; \ No newline at end of file diff --git a/commands/configuration/language.js b/commands/configuration/language.js deleted file mode 100644 index a0b46c3..0000000 --- a/commands/configuration/language.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = { - name: 'language', - description: 'Changes the bot language', - cat: 'configuration', - args: true, - usage: 'fr/en/de', - exemple: 'fr', - aliases: ["setlang", "lang"], - usages: ['language fr', "language en", "language de"], - permissions: ['MANAGE_GUILD'], - async execute(message, args, client, guildDB) { - if (args[0] === 'fr' || args[0] === 'french' || args[0] === 'français') { - if (guildDB.lang === 'fr') { - message.errorMessage(`Ma langue sur ce serveur est déja le français`) - return; - } else { - guildDB.lang = 'fr'; - guildDB.save(); - let x = await message.translate("LANGUAGE_GOOD_SET", "fr") - return message.channel.send({ content: x, allowedMentions: { repliedUser: false } }) - } - } - if (args[0] === 'en' || args[0] === 'english' || args[0] === 'england' || args[0] === 'anglais') { - if (guildDB.lang === 'en') { - message.errorMessage(`My language on this server is already english`) - return; - } else { - guildDB.lang = 'en'; - guildDB.save(); - let x = await message.translate("LANGUAGE_GOOD_SET", "en") - return message.channel.send({ content: x, allowedMentions: { repliedUser: false } }) - } - } - if (args[0] === 'de' || args[0] === 'deutsch' || args[0] === 'german' || args[0] === 'allemand ') { - if (guildDB.lang === 'de') { - message.errorMessage(`Meine Sprache auf diesem Server ist bereits Deutsch`) - return; - } else { - guildDB.lang = 'de'; - guildDB.save(); - let x = await message.translate("LANGUAGE_GOOD_SET", "de") - return message.channel.send({ content: x, allowedMentions: { repliedUser: false } }) - } - } - if (args[0] === 'de' || args[0] === 'deutsch' || args[0] === 'german' || args[0] === 'allemand ') { - if (message.guild.settings.lang === 'de') { - message.errorMessage(`Meine Sprache auf diesem Server ist bereits Deutsch`) - return; - } else { - const newchannel = await guildData.findOneAndUpdate({ serverID: message.guild.id, }, { $set: { lang: "de" } }, { new: true }); - message.guild.settings.lang = "de"; - let x = await message.translate("LANGUAGE_GOOD_SET") - return message.reply({ content: x, allowedMentions: { repliedUser: false } }) - } - } else { - const no = await message.translate("LANG_NO_CORRECT", guildDB.lang) - message.errorMessage(no) - - } - }, -}; \ No newline at end of file diff --git a/commands/configuration/setprefix.js b/commands/configuration/setprefix.js deleted file mode 100644 index 7de517e..0000000 --- a/commands/configuration/setprefix.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - name: 'setprefix', - description: 'Sets the bot prefix', - usage: '', - args: true, - cat: 'configuration', - exemple: '!', - cooldown: 15, - aliases: ["prefix"], - permissions: ['MANAGE_GUILD'], - async execute(message, args, client, guildDB) { - const lang = await message.translate("SET_PREFIX", guildDB.lang) - let prefix = args.join("") - if (prefix === "default" || prefix === "reset") prefix = "*" - if (prefix.length > 4 || prefix.length < 0) return message.errorMessage(lang.err.replace("{prefix}", prefix)); - if (prefix.startsWith("<") && prefix.endsWith(">")) return message.errorMessage("Hooks such as `[]` or `<>` must not be used when executing commands. Ex: `" + guildDB.prefix + "setprefix !`") - if (prefix === guildDB.prefix) return message.errorMessage(lang.already) - guildDB.prefix = prefix; - guildDB.save() - return message.succesMessage(lang.ok.replace("{prefix}", args[0]).replace("{prefix}", args[0])) - }, -}; \ No newline at end of file diff --git a/commands/configuration/settings.js b/commands/configuration/settings.js deleted file mode 100644 index ad4858a..0000000 --- a/commands/configuration/settings.js +++ /dev/null @@ -1,15 +0,0 @@ -const Discord = require("discord.js") -module.exports = { - name: 'settings', - description: 'Show the guild settings', - aliases: ["config"], - permissions: ['MANAGE_GUILD'], - async execute(message, args, client, guildDB) { - const embede = new Discord.MessageEmbed() - .setAuthor(message.guild.name, message.guild.icon ? message.guild.iconURL({ dynamic: true }) : "https://cdn.discordapp.com/attachments/748897191879245834/782271474450825226/0.png?size=128", client.config.links.invite) - .setDescription(`> Prefix: \`${guildDB.prefix}\`\n> Language: ${guildDB.lang.replace("en",":flag_gb:").replace("fr",":flag_fr:").replace("de",":flag_de:")}\n\nAnnoucing new songs: ${guildDB.announce ? "`Enabled`" :"`Disabled`"}\nDefault volume: \`${guildDB.defaultVolume}\`\nDj role: ${guildDB.dj_role ? `<@&${guildDB.dj_role}>` :"`No set`"}\n24/7: ${guildDB.h24 ? "`Enabled`" :"`Disabled`"}\nVoice channel: ${guildDB.vc ? `<#${guildDB.vc}>` :"`No set`"}\nClearing: ${guildDB.clearing ? "`Enabled`":"`Disabled`"}\nAuto shuffle Playlist: ${guildDB.auto_shuffle ? "`Enabled`" : "`Disabled`"}\n\n **Music controller**\n Channel: ${guildDB.requestChannel ? `<#${guildDB.requestChannel}>` : "`Not set`"}`) - .setFooter(`${message.client.footer}`, message.client.user.displayAvatarURL({ dynamic: true, size: 512 })) - .setColor("#3A871F") - message.channel.send({ embeds: [embede] }) - }, -}; \ No newline at end of file diff --git a/commands/configuration/setvc.js b/commands/configuration/setvc.js deleted file mode 100644 index cb6a350..0000000 --- a/commands/configuration/setvc.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - name: 'setvc', - description: 'Restricts the bot to a specific voice channel', - cat: 'configuration', - args: 'channel', - usage: '#channel/disable', - usages: ["setvc #channel", "setvc disable"], - exemple: 'voice', - permissions: ['MANAGE_GUILD'], - async execute(message, args, client, guildDB) { - const lang = await message.translate("SETVC", guildDB.lang) - if (args[0] === 'disable') { - if (guildDB.vc) { - guildDB.vc = null; - guildDB.save(); - return message.succesMessage(lang.disable) - } else { - let required = await message.translate("CONGIG_REQUIRED", guildDB.lang) - return message.errorMessage(required) - } - } - let a = args.join(" ") - let channel = message.mentions.channels.first() || message.guild.channels.cache.get(args[0]) || message.guild.channels.cache.filter(c => c.name.toLowerCase().includes(a.toLowerCase())).first(); - if (!channel || channel.type !== 'GUILD_VOICE' || channel.guild.id !== message.guild.id) { - let errorChannel = await message.translate("ERROR_CHANNEL_VOICE", guildDB.lang) - return message.errorMessage(errorChannel) - } - if (guildDB.vc && guildDB.vc === channel.id) { - return message.errorMessage(lang.already) - } - guildDB.vc = channel.id; - guildDB.save() - return message.succesMessage(lang.succes.replace("{channel}", channel)) - }, -}; \ No newline at end of file diff --git a/commands/filters/8D.js b/commands/filters/8D.js deleted file mode 100644 index baa746d..0000000 --- a/commands/filters/8D.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = { - name: '8d', - description: 'Toggles 8D filter', - cat: 'filters', - exemple: 'enable', - premium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("8D", guildDB.lang) - if (!queue.getFiltersEnabled().includes("8D")) { - await queue.setFilters({ - "8D": true, - normalizer2: true // because we need to toggle it with bass - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - "8D": false, - normalizer2: false, // because we need to toggle it with bass - }); - return message.succesMessage(lang.disabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/filters/bassboost.js b/commands/filters/bassboost.js deleted file mode 100644 index d7fa577..0000000 --- a/commands/filters/bassboost.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = { - name: 'bassboost', - description: 'Toggles bassboost filter', - cat: 'filters', - exemple: 'enable', - premium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("BASSBOOST", guildDB.lang) - if (!queue.getFiltersEnabled().includes("bassboost")) { - await queue.setFilters({ - bassboost: true, - normalizer2: true // because we need to toggle it with bass - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - bassboost: false, - - normalizer2: false, // because we need to toggle it with bass - }); - return message.succesMessage(lang.disabled, true); - }; - - }, -}; \ No newline at end of file diff --git a/commands/filters/earrape.js b/commands/filters/earrape.js deleted file mode 100644 index 529cda5..0000000 --- a/commands/filters/earrape.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = { - name: 'earrape', - description: 'Toggles earrape filter', - cat: 'filters', - exemple: 'enable', - Rpremium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("Earrape", guildDB.lang) - if (!queue.getFiltersEnabled().includes("earrape")) { - await queue.setFilters({ - earrape: true, - normalizer2: true, // because we need to toggle it with bass - - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - earrape: false, - normalizer2: false, // because we need to toggle it with bass - - }); - return message.succesMessage(lang.disabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/filters/karaoke.js b/commands/filters/karaoke.js deleted file mode 100644 index 8631407..0000000 --- a/commands/filters/karaoke.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = { - name: 'karaoke', - description: 'Toggles karaoke filter', - cat: 'filters', - exemple: 'enable', - Rpremium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("KARAOKE", guildDB.lang) - if (!queue.getFiltersEnabled().includes("karaoke")) { - await queue.setFilters({ - karaoke: true, - normalizer2: true // because we need to toggle it with bass - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - karaoke: false, - normalizer2: false, // because we need to toggle it with bass - }); - return message.succesMessage(lang.disabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/filters/nightcore.js b/commands/filters/nightcore.js deleted file mode 100644 index b8bd177..0000000 --- a/commands/filters/nightcore.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = { - name: 'nightcore', - description: 'Toggles nightcore filter', - cat: 'filters', - exemple: 'enable', - premium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("NIGHTCODE", guildDB.lang) - if (!queue.getFiltersEnabled().includes("nightcore")) { - await queue.setFilters({ - nightcore: true, - normalizer2: true, // because we need to toggle it with bass - - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - nightcore: false, - normalizer2: false, // because we need to toggle it with bass - - }); - return message.succesMessage(lang.disabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/filters/vaporwave.js b/commands/filters/vaporwave.js deleted file mode 100644 index b800525..0000000 --- a/commands/filters/vaporwave.js +++ /dev/null @@ -1,47 +0,0 @@ -module.exports = { - name: 'vaporwave', - description: 'Toggles vaporwave filter', - cat: 'filters', - exemple: 'enable', - Rpremium: true, - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - - const lang = await message.translate("vaporwave", guildDB.lang) - if (!queue.getFiltersEnabled().includes("vaporwave")) { - await queue.setFilters({ - vaporwave: true, - normalizer2: true // because we need to toggle it with bass - }); - return message.succesMessage(lang.enabled, true); - } else { - await queue.setFilters({ - vaporwave: false, - normalizer2: false, // because we need to toggle it with bass - }); - return message.succesMessage(lang.disabled, true); - }; - }, -}; \ No newline at end of file diff --git a/commands/music/back.js b/commands/music/back.js deleted file mode 100644 index aa80c20..0000000 --- a/commands/music/back.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = { - name: 'back', - description: 'Joue la musique précédente', - cat: 'music', - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - let err = await message.translate("NOT_VOC", guildDB.lang) - return message.errorMessage(err) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - let err = await message.translate("NOT_MUSIC", guildDB.lang) - return message.errorMessage(err) - } - - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - let err = await message.translate("NOT_SAME_CHANNEL", guildDB.lang) - return message.errorMessage(err); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("BACK", guildDB.lang) - if (!queue.previousTracks[0] || queue.previousTracks.lenght == 0) return message.errorMessage(lang.err) - if (queue.previousTracks.length > 1) { - const backed = queue.back(); - if (backed) { - message.channel.send(lang.ok) - } else { - return message.errorMessage(lang.err) - } - } else { - return message.errorMessage(lang.err) - } - }, -}; \ No newline at end of file diff --git a/commands/music/clearqueue.js b/commands/music/clearqueue.js deleted file mode 100644 index 77e8f30..0000000 --- a/commands/music/clearqueue.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - name: 'clearqueue', - description: 'Clear the music queue, does not stop the current song if there is one.', - permissions: false, - aliases: [, "cq", "clearqueue"], - cat: 'music', - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const voice = message.member.voice.channel; - if (!voice) { - return message.errorMessage(message.translate("NOT_VOC", guildDB.lang)) - } - const queue = message.client.player.getQueue(message.guild.id) - if (!queue || !queue.playing) { - return message.errorMessage(message.translate("NOT_MUSIC", guildDB.lang)) - } - if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) { - return message.errorMessage(message.translate("NOT_SAME_CHANNEL", guildDB.lang)); - } - if (guildDB.dj_role && queue.metadata.dj.id !== message.author.id) { - if (!message.member.permissions.has("MANAGE_MESSAGES")) { - let MissingRole = await message.translate("MISSING_ROLE", guildDB.lang); - let Missingperm = await message.translate("MISSING_PERMISSIONS", guildDB.lang); - let role = message.guild.roles.cache.get(guildDB.dj_role) - if (!role) return message.errorMessage(Missingperm.replace("{perm}", 'Manage messages')) - if (message.member.roles.cache) { - if (!message.member.roles.cache.has(role.id)) return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } else return message.errorMessage(MissingRole.replace("{perm}", 'Manage messages').replace("{role}", role.name)) - } - } - const lang = await message.translate("CLEAR_QUEUE", guildDB.lang) - if (queue.tracks.length <= 1) return message.errorMessage(lang.err); - queue.clear() - message.succesMessage(lang.ok) - }, -}; \ No newline at end of file diff --git a/commands/music/debug.js b/commands/music/debug.js deleted file mode 100644 index a1474ad..0000000 --- a/commands/music/debug.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = { - name: 'debug', - description: 'Debugs the player', - cat: 'music', - botpermissions: ['CONNECT', 'SPEAK'], - async execute(message, args, client, guildDB) { - const queue = message.client.player.getQueue(message.guild.id) - if (!queue) { - let err = await message.translate("NOT_MUSIC", guildDB.lang) - return message.errorMessage(err) - } - message.channel.send({ - embeds: [{ - title: "Player for " + message.guild.name + "", - color: guildDB.color, - fields: [{ - name: "• State", - value: `\`${queue.connection.status.toUpperCase()}\``, - inline: true - }, - { - name: "• Paused", - value: queue.connection.paused ? "`true`" : "`false`", - inline: true - }, - { - name: "• Volume", - value: `\`${queue.connection.volume}\``, - inline: true - }, - { - name: "• Current", - value: `${queue.current ? queue.current.title :"Nothing"}`, - }, - { - name: "• Voice channel", - value: `${queue.connection.channel}`, - inline: true - }, - { - name: "• Text channel", - value: `${queue.metadata.channel}`, - inline: true - } - - ], - footer: { - text: message.client.footer, - icon_url: message.client.user.displayAvatarURL({ dynamic: true, size: 512 }) - }, - author: { - name: `${message.author.username}`, - icon_url: message.author.displayAvatarURL({ dynamic: true, size: 512 }), - url: client.config.links.invite - } - }] - }) - - - }, -}; \ No newline at end of file diff --git a/commands/music/forward.js b/commands/music/forward.js deleted file mode 100644 index ea3bf31..0000000 --- a/commands/music/forward.js +++ /dev/null @@ -1,47 +0,0 @@ -const ms = require("ms") -module.exports = { - name: 'forward', - description: ' Fast-forwards a song by the provided time, default is 10 seconds', - cat: 'music', - aliases: ['advance'], - usage: '