ui updates and bot updates. new commands and command handler

This commit is contained in:
2025-10-03 19:53:23 -04:00
parent 524a6cc633
commit f63fca3f1b
20 changed files with 831 additions and 125 deletions

View File

@@ -0,0 +1,29 @@
const { SlashCommandBuilder } = require('discord.js');
const { readDb } = require('../../backend/db.js');
module.exports = {
name: 'view-autorole',
description: 'View the current autorole configuration for this server.',
enabled: true,
builder: new SlashCommandBuilder()
.setName('view-autorole')
.setDescription('View the current autorole configuration for this server.'),
async execute(interaction) {
const db = readDb();
const guildId = interaction.guildId;
const settings = db[guildId] || {};
const autorole = settings.autorole || { enabled: false, roleId: '' };
if (!autorole.enabled) {
await interaction.reply({ content: 'Autorole is currently disabled for this server.', flags: 64 });
return;
}
const role = interaction.guild.roles.cache.get(autorole.roleId);
if (role) {
await interaction.reply({ content: `Autorole is enabled. Selected role: ${role.toString()} (${role.name}).`, flags: 64 });
} else {
await interaction.reply({ content: `Autorole is enabled but the selected role (ID: ${autorole.roleId}) was not found on this server.`, flags: 64 });
}
},
};