module.exports = {
data: new SlashCommandBuilder()
.setName('addrolereact')
.setDescription('Reaction Role Addition')
.addStringOption(option =>
option
.setName('role_id')
.setDescription('The ID of the role to assign when reacted to')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('message_text')
.setDescription('Custom text for the reaction message')
),
async execute(interaction, client) {
const roleOption = interaction.options.getString('role_id'); // <-- This is the broken line
if (!roleOptionId) {
return interaction.reply({ content: "Role ID option is missing or not a valid string.", ephemeral: true });
}
const roleId = roleOption;
const customText = interaction.options.getString('message_text'); // 'message_text' is optional
// Ensure roleId is a valid role ID
const role = interaction.guild.roles.cache.get(roleId);
if (!role) {
return interaction.reply({ content: "Invalid role ID!", ephemeral: true });
}
module.exports = {
data: new SlashCommandBuilder()
.setName('addrolereact')
.setDescription('Reaction Role Addition')
.addStringOption(option =>
option
.setName('role_id')
.setDescription('The ID of the role to assign when reacted to')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('message_text')
.setDescription('Custom text for the reaction message')
),
async execute(interaction, client) {
const roleOption = interaction.options.getString('role_id'); // <-- This is the broken line
if (!roleOptionId) {
return interaction.reply({ content: "Role ID option is missing or not a valid string.", ephemeral: true });
}
const roleId = roleOption;
const customText = interaction.options.getString('message_text'); // 'message_text' is optional
// Ensure roleId is a valid role ID
const role = interaction.guild.roles.cache.get(roleId);
if (!role) {
return interaction.reply({ content: "Invalid role ID!", ephemeral: true });
}