mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
feat!: Moved source into /src folder
This commit is contained in:
1 parent
6d182c627a
commit
ee274feb2b
20 files changed
+63
-37
No files matched your search
@@ -2,3 +2,5 @@
|
|||||||
/config.json
|
/config.json
|
||||||
/.env
|
/.env
|
||||||
/app-*.log
|
/app-*.log
|
||||||
|
/logs
|
||||||
|
/logs/app-*.log
|
||||||
+4
-4
@@ -19,10 +19,10 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node ./index.js",
|
"start": "node ./src/index.js",
|
||||||
"start-pretty": "node ./index.js | pino-pretty",
|
"start-pretty": "node ./src/index.js | pino-pretty",
|
||||||
"deploy": "node ./deploy-commands.js && node ./deploy-system-commands.js",
|
"deploy": "node ./src/deploy-commands.js && node ./src/deploy-system-commands.js",
|
||||||
"deploy-pretty": "node ./deploy-commands.js | pino-pretty && node ./deploy-system-commands.js | pino-pretty",
|
"deploy-pretty": "node ./src/deploy-commands.js | pino-pretty && node ./src/deploy-system-commands.js | pino-pretty",
|
||||||
"eslint": "eslint ./"
|
"eslint": "eslint ./"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const {
|
const {
|
||||||
@@ -12,7 +13,7 @@ const {
|
|||||||
embedIcons,
|
embedIcons,
|
||||||
filterList,
|
filterList,
|
||||||
filterThreadAmount
|
filterThreadAmount
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons, botInfo } = require('../config.json');
|
const { embedColors, embedIcons, botInfo } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons, botInfo } = require('../config.json');
|
const { embedColors, embedIcons, botInfo } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');
|
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');
|
||||||
@@ -5,7 +6,7 @@ const {
|
|||||||
embedColors,
|
embedColors,
|
||||||
embedIcons,
|
embedIcons,
|
||||||
progressBarOptions
|
progressBarOptions
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useMainPlayer, useQueue } = require('discord-player');
|
const { useMainPlayer, useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
@@ -6,7 +7,7 @@ const {
|
|||||||
embedIcons,
|
embedIcons,
|
||||||
playerOptions,
|
playerOptions,
|
||||||
botInfo
|
botInfo
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
@@ -5,7 +6,7 @@ const {
|
|||||||
embedColors,
|
embedColors,
|
||||||
embedIcons,
|
embedIcons,
|
||||||
progressBarOptions
|
progressBarOptions
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors, embedIcons } = require('../config.json');
|
const { embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
|
const path = require('path');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const logger = require('./services/logger.js');
|
const logger = require(path.resolve('./src/services/logger.js'));
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
const commands = [];
|
const commands = [];
|
||||||
const commandFiles = fs
|
const commandFiles = fs
|
||||||
.readdirSync('./commands')
|
.readdirSync(path.resolve('./src/commands'))
|
||||||
.filter((file) => file.endsWith('.js'));
|
.filter((file) => file.endsWith('.js'));
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`./commands/${file}`);
|
const command = require(path.resolve(`./src/commands/${file}`));
|
||||||
commands.push(command.data.toJSON());
|
commands.push(command.data.toJSON());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
|
const path = require('path');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const logger = require('./services/logger.js');
|
const logger = require(path.resolve('./src/services/logger.js'));
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { systemServerGuildIds } = require('./config.json');
|
const { systemServerGuildIds } = require(path.resolve('./config.json'));
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
const systemCommands = [];
|
const systemCommands = [];
|
||||||
const systemCommandFiles = fs
|
const systemCommandFiles = fs
|
||||||
.readdirSync('./system-commands')
|
.readdirSync(path.resolve('./src/system-commands'))
|
||||||
.filter((file) => file.endsWith('.js'));
|
.filter((file) => file.endsWith('.js'));
|
||||||
|
|
||||||
for (const file of systemCommandFiles) {
|
for (const file of systemCommandFiles) {
|
||||||
const systemCommand = require(`./system-commands/${file}`);
|
const systemCommand = require(path.resolve(`./src/system-commands/${file}`));
|
||||||
systemCommands.push(systemCommand.data.toJSON());
|
systemCommands.push(systemCommand.data.toJSON());
|
||||||
}
|
}
|
||||||
|
|
||||||
+13
-8
@@ -1,10 +1,13 @@
|
|||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
|
const path = require('path');
|
||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
const logger = require('./services/logger.js');
|
const logger = require(path.resolve('./src/services/logger.js'));
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { Player, onBeforeCreateStream } = require('discord-player');
|
const { Player, onBeforeCreateStream } = require('discord-player');
|
||||||
const { stream } = require('yt-stream');
|
const { stream } = require('yt-stream');
|
||||||
const { embedColors, embedIcons, botInfo } = require('./config.json');
|
const { embedColors, embedIcons, botInfo } = require(path.resolve(
|
||||||
|
'./config.json'
|
||||||
|
));
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
// Setup required permissions for the bot to work
|
// Setup required permissions for the bot to work
|
||||||
@@ -19,18 +22,20 @@ const client = new Discord.Client({
|
|||||||
// todo: extract this logic to a separate file
|
// todo: extract this logic to a separate file
|
||||||
client.commands = new Discord.Collection();
|
client.commands = new Discord.Collection();
|
||||||
const commandFiles = fs
|
const commandFiles = fs
|
||||||
.readdirSync('./commands')
|
.readdirSync(path.resolve('./src/commands'))
|
||||||
.filter((file) => file.endsWith('.js'));
|
.filter((file) => file.endsWith('.js'));
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`./commands/${file}`);
|
const command = require(path.resolve(`./src/commands/${file}`));
|
||||||
client.commands.set(command.data.name, command);
|
client.commands.set(command.data.name, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
const systemCommandFiles = fs
|
const systemCommandFiles = fs
|
||||||
.readdirSync('./system-commands')
|
.readdirSync(path.resolve('./src/system-commands'))
|
||||||
.filter((file) => file.endsWith('.js'));
|
.filter((file) => file.endsWith('.js'));
|
||||||
for (const file of systemCommandFiles) {
|
for (const file of systemCommandFiles) {
|
||||||
const systemCommand = require(`./system-commands/${file}`);
|
const systemCommand = require(path.resolve(
|
||||||
|
`./src/system-commands/${file}`
|
||||||
|
));
|
||||||
client.commands.set(systemCommand.data.name, systemCommand);
|
client.commands.set(systemCommand.data.name, systemCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,11 +69,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(`player debug event: ${message}`);
|
logger.debug(message);
|
||||||
});
|
});
|
||||||
|
|
||||||
player.events.on('debug', (message) => {
|
player.events.on('debug', (message) => {
|
||||||
logger.trace(`player queue debug event: ${message}`);
|
logger.trace(message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,7 +7,8 @@ const transport = pino.transport({
|
|||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: process.env.MINIMUM_LOG_LEVEL,
|
level: process.env.MINIMUM_LOG_LEVEL,
|
||||||
options: {
|
options: {
|
||||||
destination: './app-all.log',
|
destination: './logs/app-all.log',
|
||||||
|
mkdir: true,
|
||||||
sync: false,
|
sync: false,
|
||||||
minLength: 4096
|
minLength: 4096
|
||||||
}
|
}
|
||||||
@@ -16,7 +17,8 @@ const transport = pino.transport({
|
|||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: 'info',
|
level: 'info',
|
||||||
options: {
|
options: {
|
||||||
destination: './app-info.log',
|
destination: './logs/app-info.log',
|
||||||
|
mkdir: true,
|
||||||
sync: false,
|
sync: false,
|
||||||
minLength: 4096
|
minLength: 4096
|
||||||
}
|
}
|
||||||
@@ -25,7 +27,8 @@ const transport = pino.transport({
|
|||||||
target: 'pino/file',
|
target: 'pino/file',
|
||||||
level: 'error',
|
level: 'error',
|
||||||
options: {
|
options: {
|
||||||
destination: './app-error.log',
|
destination: './logs/app-error.log',
|
||||||
|
mkdir: true,
|
||||||
sync: false
|
sync: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const {
|
const {
|
||||||
embedColors,
|
embedColors,
|
||||||
embedIcons,
|
embedIcons,
|
||||||
systemServerGuildIds
|
systemServerGuildIds
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
@@ -5,9 +6,9 @@ const {
|
|||||||
embedColors,
|
embedColors,
|
||||||
embedIcons,
|
embedIcons,
|
||||||
systemServerGuildIds
|
systemServerGuildIds
|
||||||
} = require('../config.json');
|
} = require(path.resolve('./config.json'));
|
||||||
const osu = require('node-os-utils');
|
const osu = require('node-os-utils');
|
||||||
const packageJson = require('../package.json');
|
const packageJson = require(path.resolve('./package.json'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
Reference in new issue
Block a user