resume.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const { MessageEmbed } = require("discord.js");
  2. const { TrackUtils } = require("erela.js");
  3. module.exports = {
  4. name: "resume",
  5. description: "Resumes the music",
  6. usage: "",
  7. permissions: {
  8. channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
  9. member: [],
  10. },
  11. aliases: [],
  12. /**
  13. *
  14. * @param {import("../structures/DiscordMusicBot")} client
  15. * @param {import("discord.js").Message} message
  16. * @param {string[]} args
  17. * @param {*} param3
  18. */
  19. run: async (client, message, args, { GuildDB }) => {
  20. let player = await client.Manager.get(message.guild.id);
  21. if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
  22. if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**");
  23. //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.**`);
  24. if (player.playing) return message.channel.send("Music is already resumed!");
  25. player.pause(false);
  26. await message.react("✅");
  27. },
  28. SlashCommand: {
  29. /**
  30. *
  31. * @param {import("../structures/DiscordMusicBot")} client
  32. * @param {import("discord.js").Message} message
  33. * @param {string[]} args
  34. * @param {*} param3
  35. */
  36. run: async (client, interaction, args, { GuildDB }) => {
  37. const guild = client.guilds.cache.get(interaction.guild_id);
  38. const member = guild.members.cache.get(interaction.member.user.id);
  39. if (!member.voice.channel) return client.sendTime(interaction, "❌ | **You must be in a voice channel to use this command.**");
  40. if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return client.sendTime(interaction, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
  41. let player = await client.Manager.get(interaction.guild_id);
  42. if (!player) return client.sendTime(inter, "❌ | **Nothing is playing right now...**");
  43. if (player.playing) return client.sendTime(interaction, "Music is already resumed!");
  44. player.pause(false);
  45. client.sendTime(interaction, "**⏯ Resumed!**");
  46. },
  47. },
  48. };