mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-09-21 06:41:35 +01:00
Some checks are pending
Docker / build (push) Waiting to run
* add simple music functionality * update workflow * update Dockerfile * update Dockerfile * update Dockerfile * update Dockerfile * add few more music commands * add lyrics command * update lyrics command * add loop, and add categories to all commands * change discord status * seperate distube and change startup console theme * Update README * UPDATE LICENSE file * fix docker compose image, add better error handling for distube and update tagging workflow * switch to node-alpine image for docker * switch to node-alpine image for docker * update ascii * music commands imporvements, implement live lyrics, some guards and bot leaving on empty * use ffmpeg package rather than ffmpeg-static
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
const { SlashCommandBuilder } = require("discord.js");
|
|
const { requireVC, requireQueue } = require("../../utils/musicGuards");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("resume")
|
|
.setDescription("Resumes the paused song."),
|
|
category: "Music",
|
|
|
|
async execute(interaction, client) {
|
|
try {
|
|
await interaction.deferReply();
|
|
|
|
requireVC(interaction);
|
|
const queue = requireQueue(client, interaction);
|
|
|
|
if (!queue.paused) {
|
|
return interaction.followUp({
|
|
content: "▶️ Music is not paused.",
|
|
ephemeral: true,
|
|
});
|
|
}
|
|
|
|
queue.resume();
|
|
|
|
// If you use live lyrics, resume the scheduler to stay in sync
|
|
try {
|
|
const live = require("../../utils/liveLyricsManager");
|
|
await live.resume(queue);
|
|
} catch {}
|
|
|
|
return interaction.followUp("▶️ Resumed the music!");
|
|
} catch (e) {
|
|
console.error("resume command failed:", e);
|
|
const msg = e?.message || "❌ Failed to resume the music.";
|
|
if (interaction.deferred || interaction.replied) {
|
|
return interaction.followUp({ content: msg, ephemeral: true });
|
|
}
|
|
return interaction.reply({ content: msg, ephemeral: true });
|
|
}
|
|
},
|
|
};
|