mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: Added eslint and prettier-eslint for formatting and linting
This commit is contained in:
1 parent
78dcc1b2e9
commit
d0f1c4103a
19 files changed
+1638
-71
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": "latest"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"indent": ["error", 4],
|
||||||
|
"linebreak-style": ["error", "windows"],
|
||||||
|
"quotes": ["error", "single"],
|
||||||
|
"semi": ["error", "always"],
|
||||||
|
"camelcase": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"properties": "always"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"array-bracket-spacing": ["error", "never"],
|
||||||
|
"object-curly-spacing": ["error", "always"],
|
||||||
|
"jsx-quotes": ["error", "prefer-single"],
|
||||||
|
"key-spacing": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"afterColon": true,
|
||||||
|
"mode": "minimum"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-trailing-spaces": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"skipBlankLines": true,
|
||||||
|
"ignoreComments": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"curly": ["error", "all"]
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"semi": true,
|
||||||
|
"useTabs": false,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"arrowParens": "always",
|
||||||
|
"endOfLine": "auto",
|
||||||
|
"tabWidth": 4
|
||||||
|
}
|
||||||
+5
-5
@@ -1,5 +1,5 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const {
|
const {
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
StringSelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -37,7 +37,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -85,7 +85,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Toggle filters** (beta)\nToggle or disable audio filters for playback.`
|
'**Toggle filters** (beta)\nToggle or disable audio filters for playback.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
],
|
],
|
||||||
@@ -130,7 +130,7 @@ module.exports = {
|
|||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Disabled filters**\nDisabled all audio filters.`
|
'**Disabled filters**\nDisabled all audio filters.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
],
|
],
|
||||||
|
|||||||
+11
-12
@@ -1,5 +1,4 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors } = require('../config.json');
|
||||||
|
|
||||||
@@ -12,17 +11,17 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**List of commands**\n` +
|
'**List of commands**\n' +
|
||||||
`\`/help\` - Show this menu.\n` +
|
'`/help` - Show this menu.\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 searching or url.\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\` - Show information about the track currently playing.\n` +
|
'`/nowplaying` - Show information about the track currently playing.\n' +
|
||||||
`\`/filters\` - Toggle various audio filters during playback.\n` +
|
'`/filters` - 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 the current track.\n` +
|
'`/skip` `[trackNumber]` - Skip the current track.\n' +
|
||||||
`\`/remove\` \`trackNumber\` - Remove a specific track from the queue.\n` +
|
'`/remove` `trackNumber` - Remove a specific track from the queue.\n' +
|
||||||
`\`/leave\` - Remove bot from voice channel and clear the queue.\n`
|
'`/leave` - Remove bot from voice channel and clear the queue.\n'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
]
|
]
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors } = require('../config.json');
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -31,7 +31,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nNo tracks are currently playing, and the queue is empty. Use the \`/play\` command to play some music!`
|
'**Failed**\nNo tracks are currently playing, and the queue is empty. Use the `/play` command to play some music!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -45,7 +45,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Leaving**\nCleared the track queue and left voice channel. To play more music, use the \`/play\` command!`
|
'**Leaving**\nCleared the track queue and left voice channel. To play more music, use the `/play` command!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorSuccess)
|
.setColor(embedColors.colorSuccess)
|
||||||
]
|
]
|
||||||
|
|||||||
+16
-16
@@ -13,7 +13,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -39,29 +39,29 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue or currently playing.`
|
'**Failed**\nThere are no tracks in the queue or currently playing.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const sourceStringsFormatted = {
|
const sourceStringsFormatted = new Map([
|
||||||
youtube: 'YouTube',
|
['youtube', 'YouTube'],
|
||||||
soundcloud: 'SoundCloud',
|
['soundcloud', 'SoundCloud'],
|
||||||
spotify: 'Spotify',
|
['spotify', 'Spotify'],
|
||||||
apple_music: 'Apple Music',
|
['apple_music', 'Apple Music'],
|
||||||
arbitrary: 'Direct source'
|
['arbitrary', 'Direct source']
|
||||||
};
|
]);
|
||||||
|
|
||||||
const currentTrack = queue.currentTrack;
|
const currentTrack = queue.currentTrack;
|
||||||
const author = currentTrack.author ? currentTrack.author : 'Unknown';
|
let author = currentTrack.author ? currentTrack.author : 'Unknown';
|
||||||
if (author === 'cdn.discordapp.com') {
|
if (author === 'cdn.discordapp.com') {
|
||||||
author = 'Unknown';
|
author = 'Unknown';
|
||||||
}
|
}
|
||||||
const plays = currentTrack.views !== 0 ? currentTrack.views : 'Unknown';
|
const plays = currentTrack.views !== 0 ? currentTrack.views : 'Unknown';
|
||||||
const source =
|
const source =
|
||||||
sourceStringsFormatted[currentTrack.raw.source] ?? 'Unknown';
|
sourceStringsFormatted.get(currentTrack.raw.source) ?? 'Unknown';
|
||||||
const queueLength = queue.tracks.data.length;
|
const queueLength = queue.tracks.data.length;
|
||||||
const timestamp = queue.node.getTimestamp();
|
const timestamp = queue.node.getTimestamp();
|
||||||
let bar = `\`${
|
let bar = `\`${
|
||||||
@@ -98,8 +98,8 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
(queue.node.isPaused()
|
(queue.node.isPaused()
|
||||||
? `**Currently Paused**\n`
|
? '**Currently Paused**\n'
|
||||||
: `**Now Playing**\n`) +
|
: '**Now Playing**\n') +
|
||||||
(currentTrack
|
(currentTrack
|
||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
? `**[${currentTrack.title}](${currentTrack.url})**`
|
||||||
: 'None') +
|
: 'None') +
|
||||||
@@ -152,7 +152,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue and nothing currently playing.`
|
'**Failed**\nThere are no tracks in the queue and nothing currently playing.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
],
|
],
|
||||||
@@ -165,7 +165,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed to skip**\nThis track has already been skipped, or is no longer playing.`
|
'**Failed to skip**\nThis track has already been skipped, or is no longer playing.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
],
|
],
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors } = require('../config.json');
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -39,7 +39,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue or currently playing.`
|
'**Failed**\nThere are no tracks in the queue or currently playing.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
|
|||||||
+6
-4
@@ -6,7 +6,9 @@ const { embedColors, playerOptions } = require('../config.json');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('play')
|
.setName('play')
|
||||||
.setDescription('Add a track or playlist to the queue by searching or url.')
|
.setDescription(
|
||||||
|
'Add a track or playlist to the queue by searching or url.'
|
||||||
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('query')
|
.setName('query')
|
||||||
@@ -19,7 +21,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -54,7 +56,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Unsupported Source**\nThis audio source is a YouTube live stream, which is currently not a supported format.\n\n_If you think that this is incorrect, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._`
|
'**Unsupported Source**\nThis audio source is a YouTube live stream, which is currently not a supported format.\n\n_If you think that this is incorrect, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -90,7 +92,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nFailed to add track to queue. Please try again.`
|
'**Failed**\nFailed to add track to queue. Please try again.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorError)
|
.setColor(embedColors.colorError)
|
||||||
]
|
]
|
||||||
|
|||||||
+5
-4
@@ -19,7 +19,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -30,7 +30,8 @@ module.exports = {
|
|||||||
let queueString = '';
|
let queueString = '';
|
||||||
|
|
||||||
if (!queue) {
|
if (!queue) {
|
||||||
queueString = `There are no tracks in the queue. Add tracks with \`/play\`!`;
|
queueString =
|
||||||
|
'There are no tracks in the queue. Add tracks with `/play`!';
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -41,7 +42,7 @@ module.exports = {
|
|||||||
.setDescription(`**Queue**\n${queueString}`)
|
.setDescription(`**Queue**\n${queueString}`)
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Page 1 of 1`
|
text: 'Page 1 of 1'
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -125,7 +126,7 @@ module.exports = {
|
|||||||
iconURL: interaction.guild.iconURL()
|
iconURL: interaction.guild.iconURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Currently playing**\n` +
|
'**Currently playing**\n' +
|
||||||
(currentTrack
|
(currentTrack
|
||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
? `**[${currentTrack.title}](${currentTrack.url})**`
|
||||||
: 'None') +
|
: 'None') +
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors } = require('../config.json');
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -34,7 +34,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
|
|||||||
+3
-3
@@ -19,7 +19,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -33,7 +33,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -83,7 +83,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks in the queue and nothing currently playing.`
|
'**Failed**\nThere are no tracks in the queue and nothing currently playing.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors } = require('../config.json');
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nYou need to be in a voice channel to use this command.`
|
'**Failed**\nYou need to be in a voice channel to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -34,7 +34,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Failed**\nThere are no tracks playing or in the queue. Add tracks with \`/play\`!`
|
'**Failed**\nThere are no tracks playing or in the queue. Add tracks with `/play`!'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorWarning)
|
.setColor(embedColors.colorWarning)
|
||||||
]
|
]
|
||||||
@@ -58,7 +58,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Error**\nYou need to pick a number between \`1\` and \`100\`.`
|
'**Error**\nYou need to pick a number between `1` and `100`.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorError)
|
.setColor(embedColors.colorError)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ for (const file of systemCommandFiles) {
|
|||||||
systemCommands.push(systemCommand.data.toJSON());
|
systemCommands.push(systemCommand.data.toJSON());
|
||||||
}
|
}
|
||||||
|
|
||||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
|
const rest = new REST({ version: '10' }).setToken(
|
||||||
|
process.env.DISCORD_BOT_TOKEN
|
||||||
|
);
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
@@ -30,7 +32,10 @@ const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN)
|
|||||||
|
|
||||||
for (const systemServerGuildId of systemServerGuildIds) {
|
for (const systemServerGuildId of systemServerGuildIds) {
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(process.env.DISCORD_CLIENT_ID, systemServerGuildId),
|
Routes.applicationGuildCommands(
|
||||||
|
process.env.DISCORD_CLIENT_ID,
|
||||||
|
systemServerGuildId
|
||||||
|
),
|
||||||
{
|
{
|
||||||
body: systemCommands
|
body: systemCommands
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,9 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const command = client.commands.get(interaction.commandName);
|
const command = client.commands.get(interaction.commandName);
|
||||||
if (!command) return;
|
if (!command) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const inputTime = new Date();
|
const inputTime = new Date();
|
||||||
@@ -183,7 +185,7 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Unexpected Error**\nThere was an error while executing this command! Please try again.\n\n_If this issue persists, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._`
|
'**Unexpected Error**\nThere was an error while executing this command! Please try again.\n\n_If this issue persists, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorError)
|
.setColor(embedColors.colorError)
|
||||||
]
|
]
|
||||||
|
|||||||
Generated
+1502
File diff suppressed because it is too large.
Load diff
+6
-1
@@ -20,7 +20,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node ./index.js",
|
"start": "node ./index.js",
|
||||||
"deploy": "node ./deploy-commands.js && node ./deploy-system-commands.js"
|
"deploy": "node ./deploy-commands.js && node ./deploy-system-commands.js",
|
||||||
|
"eslint": "eslint ./"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "^4.4.0",
|
"@discord-player/extractor": "^4.4.0",
|
||||||
@@ -33,5 +34,9 @@
|
|||||||
"pino": "^8.14.1",
|
"pino": "^8.14.1",
|
||||||
"pino-pretty": "^10.0.1",
|
"pino-pretty": "^10.0.1",
|
||||||
"yt-stream": "^1.4.8"
|
"yt-stream": "^1.4.8"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^8.44.0",
|
||||||
|
"prettier-eslint": "^15.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -6,22 +6,22 @@ const transport = pino.transport({
|
|||||||
{
|
{
|
||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: process.env.MINIMUM_LOG_LEVEL,
|
level: process.env.MINIMUM_LOG_LEVEL,
|
||||||
options: { destination: `./app-all.log` }
|
options: { destination: './app-all.log' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: 'debug',
|
level: 'debug',
|
||||||
options: { destination: `./app-debug.log` }
|
options: { destination: './app-debug.log' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: 'info',
|
level: 'info',
|
||||||
options: { destination: `./app-info.log` }
|
options: { destination: './app-info.log' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: 'error',
|
level: 'error',
|
||||||
options: { destination: `./app-error.log` }
|
options: { destination: './app-error.log' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
level: process.env.MINIMUM_LOG_LEVEL_CONSOLE,
|
level: process.env.MINIMUM_LOG_LEVEL_CONSOLE,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**No permission**\nYou do not have permission to use this command.`
|
'**No permission**\nYou do not have permission to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorError)
|
.setColor(embedColors.colorError)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**No permission**\nYou do not have permission to use this command.`
|
'**No permission**\nYou do not have permission to use this command.'
|
||||||
)
|
)
|
||||||
.setColor(embedColors.colorError)
|
.setColor(embedColors.colorError)
|
||||||
]
|
]
|
||||||
@@ -39,7 +39,7 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Bot Status**\n` +
|
'**Bot Status**\n' +
|
||||||
`Uptime: \`${uptimeString}\`\n` +
|
`Uptime: \`${uptimeString}\`\n` +
|
||||||
`Memory Usage: \`${(
|
`Memory Usage: \`${(
|
||||||
process.memoryUsage().heapUsed /
|
process.memoryUsage().heapUsed /
|
||||||
|
|||||||
Reference in new issue
Block a user