Further cleanup
This commit is contained in:
parent
53ea252bfe
commit
29a48ac6ea
@ -13,9 +13,5 @@
|
||||
"previous": "⏮️",
|
||||
"confirm": "☑️",
|
||||
"cancel": "❌"
|
||||
},
|
||||
"urls": {
|
||||
"avatar": ""
|
||||
},
|
||||
"temp": {}
|
||||
}
|
||||
}
|
10
main.js
10
main.js
@ -3,8 +3,7 @@
|
||||
// dotenv for handling environment variables
|
||||
const dotenv = require('dotenv');
|
||||
dotenv.config();
|
||||
const token = process.env.TOKEN;
|
||||
const statusChannelId = process.env.statusChannelId;
|
||||
const token = process.env.TOKEN;;
|
||||
|
||||
// Discord.JS
|
||||
const { Client, GatewayIntentBits, Partials } = require('discord.js');
|
||||
@ -24,7 +23,8 @@ const client = new Client({
|
||||
// Various imports
|
||||
const fn = require('./modules/functions.js');
|
||||
const strings = require('./data/strings.json');
|
||||
const isDev = process.env.isDev;
|
||||
const isDev = process.env.DEBUG;
|
||||
const statusChannelId = process.env.STATUSCHANNELID
|
||||
|
||||
client.once('ready', () => {
|
||||
fn.collections.slashCommands(client);
|
||||
@ -46,10 +46,6 @@ client.on('interactionCreate', async interaction => {
|
||||
console.error('Slash command attempted to run but not found: /' + commandName);
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction.isButton() && interaction.component.customId == 'refresh') {
|
||||
fn.refresh(interaction);
|
||||
}
|
||||
});
|
||||
|
||||
client.login(token);
|
@ -2,7 +2,7 @@
|
||||
// dotenv for handling environment variables
|
||||
const dotenv = require('dotenv');
|
||||
dotenv.config();
|
||||
const isDev = process.env.isDev;
|
||||
const isDev = process.env.DEBUG;
|
||||
|
||||
// filesystem
|
||||
const fs = require('fs');
|
||||
@ -13,7 +13,6 @@ const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord;
|
||||
|
||||
// Various imports from other files
|
||||
const config = require('../data/config.json');
|
||||
let guildInfo = require('../data/guildInfo.json');
|
||||
const strings = require('../data/strings.json');
|
||||
const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js'));
|
||||
|
||||
@ -75,18 +74,6 @@ const functions = {
|
||||
const messageContents = { embeds: [embed], ephemeral: true };
|
||||
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));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user