mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #67 from mariusbegby/show-icon-for-track-source
Show icon for track source
This commit is contained in:
4 files changed
+33
-8
No files matched your search
+11
-1
@@ -59,6 +59,14 @@ module.exports = {
|
|||||||
['arbitrary', 'Direct source']
|
['arbitrary', 'Direct source']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const sourceIcons = new Map([
|
||||||
|
['youtube', embedIcons.sourceYouTube],
|
||||||
|
['soundcloud', embedIcons.sourceSoundCloud],
|
||||||
|
['spotify', embedIcons.sourceSpotify],
|
||||||
|
['apple_music', embedIcons.sourceAppleMusic],
|
||||||
|
['arbitrary', embedIcons.sourceArbitrary]
|
||||||
|
]);
|
||||||
|
|
||||||
const currentTrack = queue.currentTrack;
|
const currentTrack = queue.currentTrack;
|
||||||
|
|
||||||
let author = currentTrack.author ? currentTrack.author : 'Unavailable';
|
let author = currentTrack.author ? currentTrack.author : 'Unavailable';
|
||||||
@@ -157,7 +165,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '**Audio source**',
|
name: '**Audio source**',
|
||||||
value: `**[${source}](${currentTrack.url})**`,
|
value: `**${sourceIcons.get(
|
||||||
|
currentTrack.raw.source
|
||||||
|
)} [${source}](${currentTrack.url})**`,
|
||||||
inline: true
|
inline: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-2
@@ -50,7 +50,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
queueString = 'The queue is empty, add some tracks with `/play`!';
|
queueString = 'The queue is empty, add some tracks with **`/play`**!';
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -86,7 +86,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (queue.tracks.data.length === 0) {
|
if (queue.tracks.data.length === 0) {
|
||||||
queueString = 'The queue is empty, add some tracks with `/play`!';
|
queueString = 'The queue is empty, add some tracks with **`/play`**!';
|
||||||
} else {
|
} else {
|
||||||
queueString = queue.tracks.data
|
queueString = queue.tracks.data
|
||||||
.slice(pageIndex * 10, pageIndex * 10 + 10)
|
.slice(pageIndex * 10, pageIndex * 10 + 10)
|
||||||
|
|||||||
+6
-1
@@ -69,7 +69,12 @@
|
|||||||
"volumeIsMuted": "🔇",
|
"volumeIsMuted": "🔇",
|
||||||
"volumeChanged": "🔊",
|
"volumeChanged": "🔊",
|
||||||
"volumeMuted": "🔇",
|
"volumeMuted": "🔇",
|
||||||
"queue": "🎶"
|
"queue": "🎶",
|
||||||
|
"sourceArbitrary": "🎵",
|
||||||
|
"sourceAppleMusic": "🎵",
|
||||||
|
"sourceYouTube": "🎵",
|
||||||
|
"sourceSoundCloud": "🎵",
|
||||||
|
"sourceSpotify": "🎵"
|
||||||
},
|
},
|
||||||
"filterThreadAmount": "2",
|
"filterThreadAmount": "2",
|
||||||
"filterList": [
|
"filterList": [
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ onBeforeCreateStream(async (track) => {
|
|||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
player.on('debug', (message) => {
|
player.on('debug', (message) => {
|
||||||
logger.debug(message);
|
logger.debug(`player debug event: ${message}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
player.events.on('debug', (message) => {
|
player.events.on('debug', (message) => {
|
||||||
logger.trace(message);
|
logger.trace(`player queue debug event: ${message}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +82,14 @@ player.events.on('playerError', (queue, error) => {
|
|||||||
logger.error(error, 'Player audio stream error event');
|
logger.error(error, 'Player audio stream error event');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
player.events.on('playerStart', (queue, track) => {
|
||||||
|
logger.debug(`playerStart event: Started playing '${track.title}'.`);
|
||||||
|
});
|
||||||
|
|
||||||
|
player.events.on('playerSkip', (queue, track) => {
|
||||||
|
logger.debug(`playerSkip event: Failed to play '${track.title}'.`);
|
||||||
|
});
|
||||||
|
|
||||||
client.once('ready', async () => {
|
client.once('ready', async () => {
|
||||||
// This method will load all the extractors from the @discord-player/extractor package
|
// This method will load all the extractors from the @discord-player/extractor package
|
||||||
await player.extractors.loadDefault();
|
await player.extractors.loadDefault();
|
||||||
@@ -167,9 +175,11 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Warning**\n**This command took ${
|
`**${
|
||||||
|
embedIcons.warning
|
||||||
|
} Warning**\nThis command took ${
|
||||||
executionTime / 1000
|
executionTime / 1000
|
||||||
} seconds to execute.**\n\n_If you experienced problems with the command, please try again._`
|
} seconds to execute.\n\n_If you experienced problems with the command, please try again._`
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user