mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #62 from mariusbegby/add-loop-command
Add loop command
This commit is contained in:
12 files changed
+305
-49
No files matched your search
+7
-3
@@ -129,7 +129,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -148,7 +150,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -164,7 +168,7 @@ module.exports = {
|
|||||||
).label
|
).label
|
||||||
}\``
|
}\``
|
||||||
)
|
)
|
||||||
.join(', ')}`
|
.join(', ')}.`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
],
|
],
|
||||||
|
|||||||
+5
-4
@@ -13,15 +13,16 @@ module.exports = {
|
|||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`${embedIcons.rule} **List of commands**\n` +
|
`${embedIcons.rule} **List of commands**\n` +
|
||||||
'- `/play` `query` - Add a track or playlist to the queue by searching or url.\n' +
|
'- `/play` `query` - Add a track or playlist to the queue by url or search.\n' +
|
||||||
'- `/pause` - Pause or resume the current track.\n' +
|
'- `/pause` - Pause or resume the current track.\n' +
|
||||||
'- `/queue` `[page]` - Show the list of tracks added to the queue.\n' +
|
'- `/queue` `[page]` - Show the list of tracks added to the queue.\n' +
|
||||||
`- \`/nowplaying\` - ${embedIcons.new} Show information about the track currently playing.\n` +
|
`- \`/nowplaying\` - ${embedIcons.new} Show information about the track currently playing.\n` +
|
||||||
|
`- \`/loop\` \`mode\` - ${embedIcons.beta} Toggle looping a track, the whole queue or autoplay.\n` +
|
||||||
`- \`/filters\` - ${embedIcons.beta} Toggle various audio filters during playback.\n` +
|
`- \`/filters\` - ${embedIcons.beta} Toggle various audio filters during playback.\n` +
|
||||||
'- `/volume` `[percentage]` - Show or set the playback volume for tracks.\n' +
|
'- `/volume` `[percentage]` - Show or set the playback volume for tracks.\n' +
|
||||||
'- `/skip` `[trackNumber]` - Skip current or specified track.\n' +
|
'- `/skip` `[trackNumber]` - Skip to next or specified track.\n' +
|
||||||
'- `/remove` `trackNumber` - Remove a specific track from the queue.\n' +
|
'- `/remove` `trackNumber` - Remove specified track from the queue.\n' +
|
||||||
'- `/leave` - Clear the track queue and remove the bot from voice channel.\n\n' +
|
'- `/leave` - Clear the queue and remove the bot from voice channel.\n\n' +
|
||||||
`${embedIcons.support} **Support server**\nJoin the support server for help or suggestions: \n**${botInfo.supportServerInviteUrl}**\n\n` +
|
`${embedIcons.support} **Support server**\nJoin the support server for help or suggestions: \n**${botInfo.supportServerInviteUrl}**\n\n` +
|
||||||
`${embedIcons.bot} **Enjoying ${botInfo.name}?**\nAdd me to another server: \n**[Click me!](${botInfo.botInviteUrl})**`
|
`${embedIcons.bot} **Enjoying ${botInfo.name}?**\nAdd me to another server: \n**[Click me!](${botInfo.botInviteUrl})**`
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
|
const { useQueue } = require('discord-player');
|
||||||
|
const { EmbedBuilder } = require('discord.js');
|
||||||
|
const { embedColors, embedIcons, botInfo } = require('../config.json');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName('loop')
|
||||||
|
.setDescription('Toggle looping a track or the whole queue.')
|
||||||
|
.setDMPermission(false)
|
||||||
|
.addStringOption((option) =>
|
||||||
|
option
|
||||||
|
.setName('mode')
|
||||||
|
.setDescription('Track number to remove from queue.')
|
||||||
|
.setRequired(false)
|
||||||
|
.addChoices(
|
||||||
|
{ name: 'Track', value: '1' },
|
||||||
|
{ name: 'Queue', value: '2' },
|
||||||
|
{ name: 'Autoplay', value: '3' },
|
||||||
|
{ name: 'Disabled', value: '0' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
run: async ({ interaction }) => {
|
||||||
|
if (!interaction.member.voice.channel) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.warning} Oops!**\nYou need to be in a voice channel to use this command.`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorWarning)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const queue = useQueue(interaction.guild.id);
|
||||||
|
|
||||||
|
if (!queue) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.warning} Oops!**\nThere are no tracks in the queue and nothing currently playing. First add some tracks with \`/play\`!`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorWarning)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const mode = parseInt(interaction.options.getString('mode'));
|
||||||
|
const modeUserString = loopModesFormatted.get(mode);
|
||||||
|
const currentMode = queue.repeatMode;
|
||||||
|
const currentModeUserString = loopModesFormatted.get(currentMode);
|
||||||
|
|
||||||
|
if (!mode && mode !== 0) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${
|
||||||
|
currentMode === 3
|
||||||
|
? embedIcons.autoplay
|
||||||
|
: embedIcons.loop
|
||||||
|
} Current loop mode**\nThe looping mode is currently set to \`${currentModeUserString}\`.`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorInfo)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode === currentMode) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.warning} Oops!**\nLoop mode is already \`${modeUserString}\`.`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorWarning)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
queue.setRepeatMode(mode);
|
||||||
|
|
||||||
|
if (!queue.repeatMode === mode) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.error} Uh-oh... Failed to change loop mode!**\nI tried to change the loop mode to \`${modeUserString}\`, but something went wrong.\n\nYou can try to perform the command again.\n\n_If you think this message is incorrect or the issue persists, please submit a bug report in the **[support server](${botInfo.supportServerInviteUrl})**._`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorError)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queue.repeatMode === 0) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setAuthor({
|
||||||
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
|
iconURL: interaction.user.avatarURL()
|
||||||
|
})
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.success} Loop mode disabled**\nChanging loop mode from \`${currentModeUserString}\` to \`${modeUserString}\`.\n\nThe ${currentModeUserString} will no longer play on repeat!`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorSuccess)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queue.repeatMode === 3) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setAuthor({
|
||||||
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
|
iconURL: interaction.user.avatarURL()
|
||||||
|
})
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.autoplaying} Loop mode changed**\nChanging loop mode from \`${currentModeUserString}\` to \`${modeUserString}\`.\n\nWhen the queue is empty, similar tracks will start playing!`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorSuccess)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setAuthor({
|
||||||
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
|
iconURL: interaction.user.avatarURL()
|
||||||
|
})
|
||||||
|
.setDescription(
|
||||||
|
`**${embedIcons.looping} Loop mode changed**\nChanging loop mode from \`${currentModeUserString}\` to \`${modeUserString}\`.\n\nThe ${modeUserString} will now play on repeat!`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorSuccess)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
+38
-6
@@ -60,11 +60,13 @@ module.exports = {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const currentTrack = queue.currentTrack;
|
const currentTrack = queue.currentTrack;
|
||||||
|
|
||||||
let author = currentTrack.author ? currentTrack.author : 'Unavailable';
|
let author = currentTrack.author ? currentTrack.author : 'Unavailable';
|
||||||
if (author === 'cdn.discordapp.com') {
|
if (author === 'cdn.discordapp.com') {
|
||||||
author = 'Unavailable';
|
author = 'Unavailable';
|
||||||
}
|
}
|
||||||
let plays = currentTrack.views !== 0 ? currentTrack.views : 0;
|
let plays = currentTrack.views !== 0 ? currentTrack.views : 0;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
plays === 0 &&
|
plays === 0 &&
|
||||||
currentTrack.metadata.bridge &&
|
currentTrack.metadata.bridge &&
|
||||||
@@ -72,9 +74,10 @@ module.exports = {
|
|||||||
currentTrack.metadata.bridge.views !== undefined
|
currentTrack.metadata.bridge.views !== undefined
|
||||||
) {
|
) {
|
||||||
plays = currentTrack.metadata.bridge.views;
|
plays = currentTrack.metadata.bridge.views;
|
||||||
} else {
|
} else if (plays === 0) {
|
||||||
plays = 'Unavailable';
|
plays = 'Unavailable';
|
||||||
}
|
}
|
||||||
|
|
||||||
const source =
|
const source =
|
||||||
sourceStringsFormatted.get(currentTrack.raw.source) ??
|
sourceStringsFormatted.get(currentTrack.raw.source) ??
|
||||||
'Unavailable';
|
'Unavailable';
|
||||||
@@ -106,6 +109,15 @@ module.exports = {
|
|||||||
.setEmoji(embedIcons.nextTrack)
|
.setEmoji(embedIcons.nextTrack)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||||
|
|
||||||
const response = await interaction.editReply({
|
const response = await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -119,11 +131,18 @@ module.exports = {
|
|||||||
(queue.node.isPaused()
|
(queue.node.isPaused()
|
||||||
? '**Currently Paused**\n'
|
? '**Currently Paused**\n'
|
||||||
: `**${embedIcons.audioPlaying} Now Playing**\n`) +
|
: `**${embedIcons.audioPlaying} Now Playing**\n`) +
|
||||||
(currentTrack
|
`**[${currentTrack.title}](${currentTrack.url})**` +
|
||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
|
||||||
: 'None') +
|
|
||||||
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
||||||
`\n ${bar}\n\n`
|
`\n ${bar}\n\n` +
|
||||||
|
`${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplay
|
||||||
|
: embedIcons.loop
|
||||||
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with \`/loop\`.`
|
||||||
|
}`
|
||||||
)
|
)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
@@ -200,6 +219,10 @@ module.exports = {
|
|||||||
: `\`${skippedTrack.duration}\``;
|
: `\`${skippedTrack.duration}\``;
|
||||||
queue.node.skip();
|
queue.node.skip();
|
||||||
|
|
||||||
|
const repeatModeUserString = loopModesFormatted.get(
|
||||||
|
queue.repeatMode
|
||||||
|
);
|
||||||
|
|
||||||
return await interaction.followUp({
|
return await interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -210,7 +233,16 @@ module.exports = {
|
|||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.skipped} Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**.`
|
`**${embedIcons.skipped} Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**` +
|
||||||
|
`${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `\n\n**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplaying
|
||||||
|
: embedIcons.looping
|
||||||
|
} Looping**\nLoop mode is set to ${repeatModeUserString}. You can change it with \`/loop\`.`
|
||||||
|
}`
|
||||||
)
|
)
|
||||||
.setThumbnail(skippedTrack.thumbnail)
|
.setThumbnail(skippedTrack.thumbnail)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
|
|||||||
+10
-19
@@ -56,36 +56,27 @@ module.exports = {
|
|||||||
// change paused state to opposite of current state
|
// change paused state to opposite of current state
|
||||||
queue.node.setPaused(!queue.node.isPaused());
|
queue.node.setPaused(!queue.node.isPaused());
|
||||||
|
|
||||||
if (queue.node.isPaused()) {
|
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.pauseResumed} Paused track**\n**${durationFormat} [${queue.currentTrack.title}](${queue.currentTrack.url})**`
|
`**${embedIcons.pauseResumed} ${
|
||||||
|
queue.node.isPaused()
|
||||||
|
? 'Paused Track'
|
||||||
|
: 'Resumed track'
|
||||||
|
}**\n**${durationFormat} [${
|
||||||
|
queue.currentTrack.title
|
||||||
|
}](${queue.currentTrack.url})**`
|
||||||
)
|
)
|
||||||
.setThumbnail(queue.currentTrack.thumbnail)
|
.setThumbnail(queue.currentTrack.thumbnail)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
return await interaction.editReply({
|
|
||||||
embeds: [
|
|
||||||
new EmbedBuilder()
|
|
||||||
.setAuthor({
|
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
|
||||||
iconURL: interaction.user.avatarURL()
|
|
||||||
})
|
|
||||||
.setDescription(
|
|
||||||
`**${embedIcons.pauseResumed} Resumed track**\n**${durationFormat} [${queue.currentTrack.title}](${queue.currentTrack.url})**`
|
|
||||||
)
|
|
||||||
.setThumbnail(queue.currentTrack.thumbnail)
|
|
||||||
.setColor(embedColors.colorSuccess)
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
+32
-7
@@ -41,7 +41,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.warning} Oops!**\nPage \`${pageIndex + 1}\` is not a valid page number.\n\nThe queue is currently empty, first add some tracks with \`/play\`!`
|
`**${embedIcons.warning} Oops!**\nPage \`${
|
||||||
|
pageIndex + 1
|
||||||
|
}\` is not a valid page number.\n\nThe queue is currently empty, first add some tracks with \`/play\`!`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -74,7 +76,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.warning} Oops!**\nPage \`${pageIndex + 1}\` is not a valid page number.\n\nThere are only a total of \`${totalPages}\` pages in the queue.`
|
`**${embedIcons.warning} Oops!**\nPage \`${
|
||||||
|
pageIndex + 1
|
||||||
|
}\` is not a valid page number.\n\nThere are only a total of \`${totalPages}\` pages in the queue.`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -92,15 +96,34 @@ module.exports = {
|
|||||||
? ''
|
? ''
|
||||||
: `\`${track.duration}\``;
|
: `\`${track.duration}\``;
|
||||||
|
|
||||||
return `**${pageIndex * 10 + index + 1}.** ${durationFormat} **[${
|
return `**${
|
||||||
track.title
|
pageIndex * 10 + index + 1
|
||||||
}](${track.url})**`;
|
}.** ${durationFormat} **[${track.title}](${track.url})**`;
|
||||||
})
|
})
|
||||||
.join('\n');
|
.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
let currentTrack = queue.currentTrack;
|
let currentTrack = queue.currentTrack;
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||||
|
|
||||||
|
let repeatModeString = `${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplay
|
||||||
|
: embedIcons.loop
|
||||||
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with \`/loop\`.\n\n`
|
||||||
|
}`;
|
||||||
|
|
||||||
if (!currentTrack) {
|
if (!currentTrack) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
@@ -112,6 +135,7 @@ module.exports = {
|
|||||||
iconURL: interaction.guild.iconURL()
|
iconURL: interaction.guild.iconURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
|
`${repeatModeString}` +
|
||||||
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
@@ -155,8 +179,9 @@ module.exports = {
|
|||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
? `**[${currentTrack.title}](${currentTrack.url})**`
|
||||||
: 'None') +
|
: 'None') +
|
||||||
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
||||||
`\n ${bar}` +
|
`\n ${bar}\n\n` +
|
||||||
`\n\n**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
`${repeatModeString}` +
|
||||||
|
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
||||||
)
|
)
|
||||||
.setThumbnail(queue.currentTrack.thumbnail)
|
.setThumbnail(queue.currentTrack.thumbnail)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
|
|||||||
+3
-1
@@ -67,7 +67,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
|
|||||||
+25
-3
@@ -67,7 +67,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -99,15 +101,35 @@ module.exports = {
|
|||||||
: `\`${skippedTrack.duration}\``;
|
: `\`${skippedTrack.duration}\``;
|
||||||
queue.node.skip();
|
queue.node.skip();
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||||
|
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.skipped} Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**`
|
`**${embedIcons.skipped} Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**` +
|
||||||
|
`${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `\n\n**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplaying
|
||||||
|
: embedIcons.looping
|
||||||
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with \`/loop\`.`
|
||||||
|
}`
|
||||||
)
|
)
|
||||||
.setThumbnail(skippedTrack.thumbnail)
|
.setThumbnail(skippedTrack.thumbnail)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
|
|||||||
+14
-4
@@ -45,11 +45,17 @@ module.exports = {
|
|||||||
const volume = interaction.options.getNumber('percentage');
|
const volume = interaction.options.getNumber('percentage');
|
||||||
|
|
||||||
if (!volume && volume !== 0) {
|
if (!volume && volume !== 0) {
|
||||||
|
const currentVolume = queue.node.volume;
|
||||||
|
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.volume} Playback volume**\nThe playback volume is currently set to \`${queue.node.volume}%\`.`
|
`**${
|
||||||
|
currentVolume === 0
|
||||||
|
? embedIcons.volumeIsMuted
|
||||||
|
: embedIcons.volume
|
||||||
|
} Playback volume**\nThe playback volume is currently set to \`${currentVolume}%\`.`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
]
|
]
|
||||||
@@ -72,11 +78,13 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.volumeChanged} Audio muted**\nPlayback audio has been muted, because volume was set to \`${volume}%\`.`
|
`**${embedIcons.volumeMuted} Audio muted**\nPlayback audio has been muted, because volume was set to \`${volume}%\`.`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
]
|
]
|
||||||
@@ -87,7 +95,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
|
|||||||
@@ -55,12 +55,20 @@
|
|||||||
"previousTrack": "⏮️",
|
"previousTrack": "⏮️",
|
||||||
"pauseResumeTrack": "⏯️",
|
"pauseResumeTrack": "⏯️",
|
||||||
"shuffleQueue": "🔀",
|
"shuffleQueue": "🔀",
|
||||||
|
"loop": "🔁",
|
||||||
|
"loopAction": "🔁",
|
||||||
|
"autoplay": "♾️",
|
||||||
|
"autoplayAction": "♾️",
|
||||||
|
"looping": "🔁",
|
||||||
|
"autoplaying": "♾️",
|
||||||
"skipped": "⏭️",
|
"skipped": "⏭️",
|
||||||
"back": "⏮️",
|
"back": "⏮️",
|
||||||
"pauseResumed": "⏯️",
|
"pauseResumed": "⏯️",
|
||||||
"shuffled": "🔀",
|
"shuffled": "🔀",
|
||||||
"volume": "🔊",
|
"volume": "🔊",
|
||||||
|
"volumeIsMuted": "🔇",
|
||||||
"volumeChanged": "🔊",
|
"volumeChanged": "🔊",
|
||||||
|
"volumeMuted": "🔇",
|
||||||
"queue": "🎶"
|
"queue": "🎶"
|
||||||
},
|
},
|
||||||
"filterThreadAmount": "2",
|
"filterThreadAmount": "2",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ for (const file of systemCommandFiles) {
|
|||||||
const player = new Player(client, {
|
const player = new Player(client, {
|
||||||
useLegacyFFmpeg: false,
|
useLegacyFFmpeg: false,
|
||||||
ytdlOptions: {
|
ytdlOptions: {
|
||||||
|
quality: 'highestaudio',
|
||||||
|
highWaterMark: 1 << 25,
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
headers: {
|
headers: {
|
||||||
cookie: process.env.YOUTUBE_COOKIE || ''
|
cookie: process.env.YOUTUBE_COOKIE || ''
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ module.exports = {
|
|||||||
memberCount: guild.memberCount
|
memberCount: guild.memberCount
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.slice(0, 50)
|
|
||||||
.sort((a, b) => b.memberCount - a.memberCount)
|
.sort((a, b) => b.memberCount - a.memberCount)
|
||||||
.map((guild, index) => `${index + 1}. \`${guild.name} (#${guild.memberCount})\``)
|
.slice(0, 50)
|
||||||
|
.map(
|
||||||
|
(guild, index) =>
|
||||||
|
`${index + 1}. \`${guild.name} (#${guild.memberCount})\``
|
||||||
|
)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
let embedDescription = `**${embedIcons.bot} ${
|
let embedDescription = `**${embedIcons.bot} ${
|
||||||
|
|||||||
Reference in new issue
Block a user