Remove setup compare

This commit is contained in:
Skylar Grant 2023-03-11 15:14:01 -05:00
parent 024defbbfc
commit 10f8ed9438
1 changed files with 1 additions and 39 deletions

View File

@ -7,21 +7,7 @@ const { GuildInfo } = require('../modules/CustomClasses.js');
module.exports = { module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('setup') .setName('setup')
.setDescription('Attempt automatic configuration of the bot.') .setDescription('Configure some feature settings.')
.addSubcommand(sc =>
sc.setName('compare')
.setDescription('Set up the channels to be used with /compare')
.addChannelOption(o =>
o.setName('treechannel')
.setDescription('What channel is your tree in?')
.setRequired(true)
)
.addChannelOption(o =>
o.setName('leaderboardchannel')
.setDescription('What channel is your leaderboard in?')
.setRequired(true)
)
)
.addSubcommand(sc => .addSubcommand(sc =>
sc.setName('rolemenu') sc.setName('rolemenu')
.setDescription('Setup the roles to be used with /rolemenu') .setDescription('Setup the roles to be used with /rolemenu')
@ -53,30 +39,6 @@ module.exports = {
await interaction.deferReply({ ephemeral: true }); await interaction.deferReply({ ephemeral: true });
const subcommand = interaction.options.getSubcommand(); const subcommand = interaction.options.getSubcommand();
switch (subcommand) { switch (subcommand) {
case "compare":
const treeChannel = interaction.options.getChannel('treechannel');
const leaderboardChannel = interaction.options.getChannel('leaderboardchannel');
if (interaction.client.guildInfos.has(interaction.guildId)) {
let guildInfo = interaction.client.guildInfos.get(interaction.guildId);
guildInfo.setTreeMessage(undefined, treeChannel.id);
guildInfo.setLeaderboardMessage(undefined, leaderboardChannel.id);
// Update the database
await dbfn.setGuildInfo(guildInfo.queryBuilder("setTreeMessage")).catch(e => console.error(e));
await dbfn.setGuildInfo(guildInfo.queryBuilder("setLeaderboardMessage")).catch(e => console.error(e));
const reply = `Tree Channel: <#${treeChannel.id}> | Leaderboard Channel: <#${leaderboardChannel.id}>`;
await interaction.editReply(fn.builders.embed(reply)).catch(e => console.error(e));
} else {
let guildInfo = new GuildInfo()
.setId(interaction.guildId)
.setTreeMessage(undefined, treeChannel.id)
.setLeaderboardMessage(undefined, leaderboardChannel.id);
// Update the database
await dbfn.setGuildInfo(guildInfo.queryBuilder("setTreeMessage")).catch(e => console.error(e));
await dbfn.setGuildInfo(guildInfo.queryBuilder("setLeaderboardMessage")).catch(e => console.error(e));
const reply = `Tree Channel: <#${treeChannel.id}> | Leaderboard Channel: <#${leaderboardChannel.id}>`;
await interaction.editReply(fn.builders.embed(reply)).catch(e => console.error(e));
}
break;
case "rolemenu": case "rolemenu":
let waterRoleId = interaction.options.getRole('waterrole').id; let waterRoleId = interaction.options.getRole('waterrole').id;
let fruitRoleId = interaction.options.getRole('fruitrole') ? interaction.options.getRole('fruitrole').id : undefined; let fruitRoleId = interaction.options.getRole('fruitrole') ? interaction.options.getRole('fruitrole').id : undefined;