Further cleanup

This commit is contained in:
Skylar Grant 2023-02-10 20:15:23 -05:00 committed by GitHub
parent 53ea252bfe
commit 29a48ac6ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 26 deletions

View File

@ -13,9 +13,5 @@
"previous": "⏮️", "previous": "⏮️",
"confirm": "☑️", "confirm": "☑️",
"cancel": "❌" "cancel": "❌"
}, }
"urls": {
"avatar": ""
},
"temp": {}
} }

10
main.js
View File

@ -3,8 +3,7 @@
// dotenv for handling environment variables // dotenv for handling environment variables
const dotenv = require('dotenv'); const dotenv = require('dotenv');
dotenv.config(); dotenv.config();
const token = process.env.TOKEN; const token = process.env.TOKEN;;
const statusChannelId = process.env.statusChannelId;
// Discord.JS // Discord.JS
const { Client, GatewayIntentBits, Partials } = require('discord.js'); const { Client, GatewayIntentBits, Partials } = require('discord.js');
@ -24,7 +23,8 @@ const client = new Client({
// Various imports // Various imports
const fn = require('./modules/functions.js'); const fn = require('./modules/functions.js');
const strings = require('./data/strings.json'); const strings = require('./data/strings.json');
const isDev = process.env.isDev; const isDev = process.env.DEBUG;
const statusChannelId = process.env.STATUSCHANNELID
client.once('ready', () => { client.once('ready', () => {
fn.collections.slashCommands(client); fn.collections.slashCommands(client);
@ -46,10 +46,6 @@ client.on('interactionCreate', async interaction => {
console.error('Slash command attempted to run but not found: /' + commandName); console.error('Slash command attempted to run but not found: /' + commandName);
} }
} }
if (interaction.isButton() && interaction.component.customId == 'refresh') {
fn.refresh(interaction);
}
}); });
client.login(token); client.login(token);

View File

@ -2,7 +2,7 @@
// dotenv for handling environment variables // dotenv for handling environment variables
const dotenv = require('dotenv'); const dotenv = require('dotenv');
dotenv.config(); dotenv.config();
const isDev = process.env.isDev; const isDev = process.env.DEBUG;
// filesystem // filesystem
const fs = require('fs'); const fs = require('fs');
@ -13,7 +13,6 @@ const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord;
// Various imports from other files // Various imports from other files
const config = require('../data/config.json'); const config = require('../data/config.json');
let guildInfo = require('../data/guildInfo.json');
const strings = require('../data/strings.json'); const strings = require('../data/strings.json');
const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js')); const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js'));
@ -75,18 +74,6 @@ const functions = {
const messageContents = { embeds: [embed], ephemeral: true }; const messageContents = { embeds: [embed], ephemeral: true };
return messageContents; return messageContents;
} }
},
refresh(interaction) {
functions.rankings.parse(interaction).then(r1 => {
functions.tree.parse(interaction).then(r2 => {
const embed = functions.builders.comparisonEmbed(functions.rankings.compare(interaction), functions.builders.refreshAction())
interaction.update(embed);
}).catch(e => {
interaction.reply(functions.builders.errorEmbed(e));
});
}).catch(e => {
interaction.reply(functions.builders.errorEmbed(e));
});
} }
}; };