mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
fix: update eslint to respect typescript and run eslint fix
This commit is contained in:
1 parent
9125e4a5da
commit
1a7f800ba2
15 files changed
+325
-77
No files matched your search
@@ -28,9 +28,9 @@ module.exports = {
|
||||
return true;
|
||||
})
|
||||
.map((command) => {
|
||||
let params = command.data.options[0] ? `**\`${command.data.options[0].name}\`**` + ' ' : '';
|
||||
let beta = command.isBeta ? `${embedOptions.icons.beta} ` : '';
|
||||
let newCommand = command.isNew ? `${embedOptions.icons.new} ` : '';
|
||||
const params = command.data.options[0] ? `**\`${command.data.options[0].name}\`**` + ' ' : '';
|
||||
const beta = command.isBeta ? `${embedOptions.icons.beta} ` : '';
|
||||
const newCommand = command.isNew ? `${embedOptions.icons.new} ` : '';
|
||||
return `- **\`/${command.data.name}\`** ${params}- ${beta}${newCommand}${command.data.description}`;
|
||||
});
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@ module.exports = {
|
||||
return player.generateStatistics();
|
||||
})
|
||||
.then((results) => {
|
||||
let queueCountList = [];
|
||||
let trackCountList = [];
|
||||
let listenerCountList = [];
|
||||
const queueCountList = [];
|
||||
const trackCountList = [];
|
||||
const listenerCountList = [];
|
||||
results.map((result) => {
|
||||
queueCountList.push(result.queues.length);
|
||||
if (result.queues.length > 0) {
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
let filterOptions = [];
|
||||
const filterOptions = [];
|
||||
|
||||
ffmpegFilterOptions.availableFilters.forEach((filter) => {
|
||||
let isEnabled = false;
|
||||
@@ -169,7 +169,7 @@ module.exports = {
|
||||
embedOptions.icons.success
|
||||
} Filters toggled**\nNow using these filters:\n${confirmation.values
|
||||
.map((enabledFilter) => {
|
||||
let filter = ffmpegFilterOptions.availableFilters.find(
|
||||
const filter = ffmpegFilterOptions.availableFilters.find(
|
||||
(filter) => enabledFilter == filter.value
|
||||
);
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
queue = useQueue(interaction.guild.id);
|
||||
let queueSize = queue?.size ?? 0;
|
||||
const queueSize = queue?.size ?? 0;
|
||||
|
||||
if ((searchResult.playlist && searchResult.tracks.length) > playerOptions.maxQueueSize - queueSize) {
|
||||
logger.debug(`Playlist found but would exceed max queue size. Query: '${query}'.`);
|
||||
|
||||
@@ -116,7 +116,7 @@ module.exports = {
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
let currentTrack = queue.currentTrack;
|
||||
const currentTrack = queue.currentTrack;
|
||||
|
||||
const loopModesFormatted = new Map([
|
||||
[0, 'disabled'],
|
||||
@@ -127,7 +127,7 @@ module.exports = {
|
||||
|
||||
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||
|
||||
let repeatModeString = `${
|
||||
const repeatModeString = `${
|
||||
queue.repeatMode === 0
|
||||
? ''
|
||||
: `**${
|
||||
|
||||
@@ -85,7 +85,7 @@ module.exports = {
|
||||
|
||||
const durationString = durationArray.join(':');
|
||||
|
||||
let validElements = durationArray.every((value) => {
|
||||
const validElements = durationArray.every((value) => {
|
||||
return value.length === 2;
|
||||
});
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ module.exports = {
|
||||
|
||||
logger.debug(`Successfully fetched ${totalGuildCount} guilds.`);
|
||||
|
||||
let guildListFormatted = shardGuilds
|
||||
const guildListFormatted = shardGuilds
|
||||
.map((guild) => {
|
||||
return {
|
||||
name: guild.name,
|
||||
|
||||
@@ -56,11 +56,11 @@ module.exports = {
|
||||
}
|
||||
|
||||
const commands = client.commands.map((command) => {
|
||||
let params = command.data.options[0] ? `**\`${command.data.options[0].name}\`**` + ' ' : '';
|
||||
const params = command.data.options[0] ? `**\`${command.data.options[0].name}\`**` + ' ' : '';
|
||||
return `- **\`/${command.data.name}\`** ${params}- ${command.data.description}`;
|
||||
});
|
||||
|
||||
let embedDescription = `**${embedOptions.icons.bot} Reloaded commands**\n` + commands.join('\n');
|
||||
const embedDescription = `**${embedOptions.icons.bot} Reloaded commands**\n` + commands.join('\n');
|
||||
|
||||
logger.debug('Responding with success embed.');
|
||||
return await interaction.editReply({
|
||||
|
||||
@@ -50,9 +50,9 @@ module.exports = {
|
||||
await client.shard
|
||||
.broadcastEval((shardClient) => {
|
||||
/* eslint-disable no-undef */
|
||||
let playerStats = player.generateStatistics();
|
||||
const playerStats = player.generateStatistics();
|
||||
const nodeProcessMemUsageInMb = (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2);
|
||||
let shardInfo = {
|
||||
const shardInfo = {
|
||||
shardId: shardClient.shard.ids[0],
|
||||
memUsage: nodeProcessMemUsageInMb,
|
||||
guildCount: shardClient.guilds.cache.size,
|
||||
|
||||
@@ -60,9 +60,9 @@ module.exports = {
|
||||
return player.generateStatistics();
|
||||
})
|
||||
.then((results) => {
|
||||
let queueCountList = [];
|
||||
let trackCountList = [];
|
||||
let listenerCountList = [];
|
||||
const queueCountList = [];
|
||||
const trackCountList = [];
|
||||
const listenerCountList = [];
|
||||
results.map((result) => {
|
||||
queueCountList.push(result.queues.length);
|
||||
if (result.queues.length > 0) {
|
||||
|
||||
@@ -16,8 +16,8 @@ exports.postBotStats = async ({ client, executionId }) => {
|
||||
|
||||
let guildCount = 0;
|
||||
let memberCount = 0;
|
||||
let shardCount = client.shard.count;
|
||||
let shardId = client.shard.ids[0];
|
||||
const shardCount = client.shard.count;
|
||||
const shardId = client.shard.ids[0];
|
||||
|
||||
logger.debug('Gathering data about guild and member count from shards...');
|
||||
await client.shard
|
||||
@@ -119,14 +119,14 @@ exports.postBotStats = async ({ client, executionId }) => {
|
||||
|
||||
logger.info(`Starting to post bot stats with guild count ${guildCount} and member count ${memberCount}...`);
|
||||
|
||||
let statusCodes = [];
|
||||
const statusCodes = [];
|
||||
|
||||
sites.map((site) => {
|
||||
if (site.disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
let options = {
|
||||
const options = {
|
||||
protocol: 'https:',
|
||||
hostname: site.hostname,
|
||||
port: 443,
|
||||
@@ -138,7 +138,7 @@ exports.postBotStats = async ({ client, executionId }) => {
|
||||
}
|
||||
};
|
||||
|
||||
let request = https.request(options, (res) => {
|
||||
const request = https.request(options, (res) => {
|
||||
res.statusCode === 200
|
||||
? logger.debug(`Request to ${site.hostname}: statusCode: ${res.statusCode}`)
|
||||
: logger.warn(`Request to ${site.hostname}: statusCode: ${res.statusCode}`);
|
||||
|
||||
@@ -10,7 +10,7 @@ exports.getUptimeFormatted = async ({ executionId }) => {
|
||||
let uptimeFormattedString = '';
|
||||
|
||||
const uptimeInSeconds = process.uptime();
|
||||
let uptimeDate = new Date(0);
|
||||
const uptimeDate = new Date(0);
|
||||
uptimeDate.setSeconds(uptimeInSeconds.toFixed(0));
|
||||
uptimeFormattedString = `${
|
||||
uptimeDate.getUTCDate() - 1
|
||||
|
||||
Reference in new issue
Block a user