Merge branch 'v5' of https://github.com/Androz2091/discord-player into v5
This commit is contained in:
commit
2353f723b1
1 changed files with 10 additions and 10 deletions
|
@ -164,7 +164,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interaction.commandName === "play" || interaction.commandName === "soundcloud") {
|
if (interaction.commandName === "play" || interaction.commandName === "soundcloud") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
|
|
||||||
const query = interaction.options.get("query").value;
|
const query = interaction.options.get("query").value;
|
||||||
const searchResult = await player
|
const searchResult = await player
|
||||||
|
@ -190,7 +190,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
searchResult.playlist ? queue.addTracks(searchResult.tracks) : queue.addTrack(searchResult.tracks[0]);
|
searchResult.playlist ? queue.addTracks(searchResult.tracks) : queue.addTrack(searchResult.tracks[0]);
|
||||||
if (!queue.playing) await queue.play();
|
if (!queue.playing) await queue.play();
|
||||||
} else if (interaction.commandName === "volume") {
|
} else if (interaction.commandName === "volume") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const vol = interaction.options.get("amount");
|
const vol = interaction.options.get("amount");
|
||||||
|
@ -201,7 +201,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
content: success ? `✅ | Volume set to **${vol.value}%**!` : "❌ | Something went wrong!"
|
content: success ? `✅ | Volume set to **${vol.value}%**!` : "❌ | Something went wrong!"
|
||||||
});
|
});
|
||||||
} else if (interaction.commandName === "skip") {
|
} else if (interaction.commandName === "skip") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const currentTrack = queue.current;
|
const currentTrack = queue.current;
|
||||||
|
@ -210,7 +210,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
content: success ? `✅ | Skipped **${currentTrack}**!` : "❌ | Something went wrong!"
|
content: success ? `✅ | Skipped **${currentTrack}**!` : "❌ | Something went wrong!"
|
||||||
});
|
});
|
||||||
} else if (interaction.commandName === "queue") {
|
} else if (interaction.commandName === "queue") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const currentTrack = queue.current;
|
const currentTrack = queue.current;
|
||||||
|
@ -233,25 +233,25 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else if (interaction.commandName === "pause") {
|
} else if (interaction.commandName === "pause") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const success = queue.setPaused(true);
|
const success = queue.setPaused(true);
|
||||||
return void interaction.followUp({ content: success ? "⏸ | Paused!" : "❌ | Something went wrong!" });
|
return void interaction.followUp({ content: success ? "⏸ | Paused!" : "❌ | Something went wrong!" });
|
||||||
} else if (interaction.commandName === "resume") {
|
} else if (interaction.commandName === "resume") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const success = queue.setPaused(false);
|
const success = queue.setPaused(false);
|
||||||
return void interaction.followUp({ content: success ? "▶ | Resumed!" : "❌ | Something went wrong!" });
|
return void interaction.followUp({ content: success ? "▶ | Resumed!" : "❌ | Something went wrong!" });
|
||||||
} else if (interaction.commandName === "stop") {
|
} else if (interaction.commandName === "stop") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
queue.destroy();
|
queue.destroy();
|
||||||
return void interaction.followUp({ content: "🛑 | Stopped the player!" });
|
return void interaction.followUp({ content: "🛑 | Stopped the player!" });
|
||||||
} else if (interaction.commandName === "np") {
|
} else if (interaction.commandName === "np") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const progress = queue.createProgressBar();
|
const progress = queue.createProgressBar();
|
||||||
|
@ -273,7 +273,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else if (interaction.commandName === "loop") {
|
} else if (interaction.commandName === "loop") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
const loopMode = interaction.options.get("mode").value;
|
const loopMode = interaction.options.get("mode").value;
|
||||||
|
@ -281,7 +281,7 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
const mode = loopMode === QueueRepeatMode.TRACK ? "🔂" : loopMode === QueueRepeatMode.QUEUE ? "🔁" : "▶";
|
const mode = loopMode === QueueRepeatMode.TRACK ? "🔂" : loopMode === QueueRepeatMode.QUEUE ? "🔁" : "▶";
|
||||||
return void interaction.followUp({ content: success ? `${mode} | Updated loop mode!` : "❌ | Could not update loop mode!" });
|
return void interaction.followUp({ content: success ? `${mode} | Updated loop mode!` : "❌ | Could not update loop mode!" });
|
||||||
} else if (interaction.commandName === "bassboost") {
|
} else if (interaction.commandName === "bassboost") {
|
||||||
await interaction.defer();
|
await interaction.deferReply();
|
||||||
const queue = player.getQueue(interaction.guildId);
|
const queue = player.getQueue(interaction.guildId);
|
||||||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||||
await queue.setFilters({
|
await queue.setFilters({
|
||||||
|
|
Loading…
Reference in a new issue