bug fixes

This commit is contained in:
2025-10-10 18:51:23 -04:00
parent 8236c1e0e7
commit 61ab1e1d9e
15 changed files with 4463 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
module.exports = {
name: 'post-reaction-role',
description: 'Post a reaction role message for the given reaction role ID',
builder: (builder) => builder.setName('post-reaction-role').setDescription('Post a reaction role message').addIntegerOption(opt => opt.setName('id').setDescription('Reaction role ID').setRequired(true)),
async execute(interaction) {
const id = interaction.options.getInteger('id');
try {
const api = require('../api');
const rrList = await api.listReactionRoles(interaction.guildId) || [];
const rr = rrList.find(r => Number(r.id) === Number(id));
if (!rr) return interaction.reply({ content: 'Reaction role not found', ephemeral: true });
const bot = require('../index');
const result = await bot.postReactionRoleMessage(interaction.guildId, rr);
if (result && result.success) return interaction.reply({ content: 'Posted reaction role message', ephemeral: true });
return interaction.reply({ content: 'Failed to post message', ephemeral: true });
} catch (e) {
console.error('post-reaction-role command error:', e);
return interaction.reply({ content: 'Internal error', ephemeral: true });
}
}
};