text: const {
  	MessageEmbed,
  	Message
  } = require("discord.js");
  const config = require("../../botconfig/config.json");
  const ee = require("../../botconfig/embed.json");
  const settings = require("../../botconfig/settings.json");
  const {
  	check_if_dj
  } = require("../../handlers/functions")
  module.exports = {
  	name: "remove", //the command name for the Slash Command
  
  	category: "Queue",
  	aliases: ["delete", "del", "rem"],
  	usage: "remove <What_song> [Amount]",
  
  	description: "Removes one+ Song(s)", //the command description for Slash Command Overview
  	cooldown: 10,
  	requiredroles: [], //Only allow specific Users with a Role to execute a Command [OPTIONAL]
  	alloweduserids: [], //Only allow specific Users to execute a Command [OPTIONAL]
  	run: async (client, message, args) => {
  		try {
  			//things u can directly access in an interaction!
  			const {
  				member,
  				channelId,
  				guildId,
  				applicationId,
  				commandName,
  				deferred,
  				replied,
  				ephemeral,
  				options,
  				id,
  				createdTimestamp
  			} = message;
  			const {
  				guild
  			} = member;
  			const {
  				channel
  			} = member.voice;
  			if (!channel) return message.reply({
  				embeds: [
  					new MessageEmbed().setColor(ee.wrongcolor).setTitle(`${client.allEmojis.x} **Please join ${guild.me.voice.channel ? "__my__" : "a"} VoiceChannel First!**`)
  				],
  
  			})
  			if (channel.guild.me.voice.channel && channel.guild.me.voice.channel.id != channel.id) {
  				return message.reply({
  					embeds: [new MessageEmbed()
  						.setColor(ee.wrongcolor)
  						.setFooter(ee.footertext, ee.footericon)
  						.setTitle(`${client.allEmojis.x} Join __my__ Voice Channel!`)
  						.setDescription(`<#${guild.me.voice.channel.id}>`)
  					],
  				});
  			}
  			try {
  				let newQueue = client.distube.getQueue(guildId);
  				if (!newQueue || !newQueue.songs || newQueue.songs.length == 0) return message.reply({
  					embeds: [
  						new MessageEmbed().setColor(ee.wrongcolor).setTitle(`${client.allEmojis.x} **I am nothing Playing right now!**`)
  					],
  
  				})
  				if (check_if_dj(client, member, newQueue.songs[0])) {
  					return message.reply({
  						embeds: [new MessageEmbed()
  							.setColor(ee.wrongcolor)
  							.setFooter(ee.footertext, ee.footericon)
  							.setTitle(`${client.allEmojis.x} **You are not a DJ and not the Song Requester!**`)
  							.setDescription(`**DJ-ROLES:**\n> ${check_if_dj(client, member, newQueue.songs[0])}`)
  						],
  					});
  				}
  				if (!args[0]) {
  					return message.reply({
  						embeds: [new MessageEmbed()
  							.setColor(ee.wrongcolor)
  							.setFooter(ee.footertext, ee.footericon)
  							.setTitle(`${client.allEmojis.x} **Please add a Song-Position!**`)
  							.setDescription(`**Usage:**\n> \`${client.settings.get(message.guild.id, "prefix")}remove <SongPosition> [Amount]\``)
  						],
  					});
  				}
  				let songIndex = Number(args[0]);
  				if (!songIndex) {
  					return message.reply({
  						embeds: [new MessageEmbed()
  							.setColor(ee.wrongcolor)
  							.setFooter(ee.footertext, ee.footericon)
  							.setTitle(`${client.allEmojis.x} **Please add a Song-Position NUMBER!**`)
  							.setDescription(`**Usage:**\n> \`${client.settings.get(message.guild.id, "prefix")}remove <SongPosition> [Amount]\``)
  						],
  					});
  				}
  				let amount = Number(args[1] ? args[1] : "1");
  				if (!amount) amount = 1;
  				if (songIndex > newQueue.songs.length - 1) return message.reply({
  					embeds: [
  						new MessageEmbed().setColor(ee.wrongcolor).setTitle(`${client.allEmojis.x} **This Song does not exist!**`)
  						.setDescription(`**The last Song in the Queue has the Index: \`${newQueue.songs.length}\`**`)
  					],
  
  				})
  				if (songIndex <= 0) return message.reply({
  					embeds: [
  						new MessageEmbed().setColor(ee.wrongcolor).setTitle(`${client.allEmojis.x} **You can't remove the current Song (0)!**`)
  						.setDescription(`**Use the \`${client.settings.get(guild.id, "prefix")}skip\` (Slash)Command instead!**`)
  					],
  
  				})
  				if (amount <= 0) return message.reply({
  					embeds: [
  						new MessageEmbed().setColor(ee.wrongcolor).setTitle(`${client.allEmojis.x} **You need to at least remove 1 Song!**`)
  					],
  
  				})
  				newQueue.songs.splice(songIndex, amount);
  				message.reply({
  					embeds: [new MessageEmbed()
  					  .setColor(ee.color)
  					  .setTimestamp()
  					  .setTitle(`🗑 **Removed ${amount} Song${amount > 1 ?"s": ""} out of the Queue!**`)
  					  .setFooter(`💢 Action by: ${member.user.tag}`, member.user.displayAvatarURL({dynamic: true}))]
  				})
  			} catch (e) {
  				console.log(e.stack ? e.stack : e)
  				message.reply({
  					content: `${client.allEmojis.x} | Error: `,
  					embeds: [
  						new MessageEmbed().setColor(ee.wrongcolor)
  						.setDescription(`\`\`\`${e}\`\`\``)
  					],
  
  				})
  			}
  		} catch (e) {
  			console.log(String(e.stack).bgRed)
  		}
  	}
  }
  // Copyright © Iconical | Discord Music Bot by Iconical
  // Github: https://github.com/iconicaal/
  // Github Music-Bot Repository: https://github.com/iconicaal/Icosical