83a05374cf
* New Name, New Version * New default branch name * Migrate to database for long term storage * Fix uncaught call to a promise * Reverse the leaderboard * QoL and Bug fixes * Handle server timeout * Pretty help message
23 lines
690 B
JavaScript
23 lines
690 B
JavaScript
const { SlashCommandBuilder } = require('discord.js');
|
|
const fn = require('../modules/functions.js');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('compare')
|
|
.setDescription('See how your tree compares to other trees!'),
|
|
async execute(interaction) {
|
|
interaction.deferReply().then(() => {
|
|
fn.rankings.compare(interaction).then(res => {
|
|
const embed = fn.builders.comparisonEmbed(res, fn.builders.refreshAction());
|
|
interaction.editReply(embed).catch(err => {
|
|
console.error(err);
|
|
});
|
|
}).catch(err => {
|
|
interaction.editReply(fn.builders.errorEmbed(err)).catch(err => {
|
|
console.error(err);
|
|
});
|
|
console.error(err);
|
|
});
|
|
})
|
|
},
|
|
}; |