#Unable to mention a role... sometimes?

1 messages · Page 1 of 1 (latest)

hardy nest
#

Hey leguchi, did you get a response to this (because I cannot find it)?

If not, gonna need some background—was this in a thread? Do you know if the id is actually correct (log the id and write a manual role mention out)? Context would help here, and code

coral glade
#

I did not get a response, but I did hear it was more of a Discord issue. It is for a private channel and the bot to mention a role in that private channel where the members of that role are included.

#
module.exports = {
    data: new ContextMenuCommandBuilder()
        .setName('EMERGENCY')
        .setType(ApplicationCommandType.Message)
        .setDefaultMemberPermissions(PermissionFlagsBits.UseApplicationCommands),
    async execute(interaction) {
        await interaction.deferReply({ ephemeral: true});
        let modChannel = interaction.client.channels.cache.get('996157352623493223');

        await query(`INSERT INTO emergency (userId, callerId, message) VALUES ('${interaction.targetMessage.author.id}', '${interaction.user.id}', '${interaction.targetMessage.content}');`);
        let modMsg = new EmbedBuilder()
            .setTitle('EMERGENCY')
            .setColor('FF0000')
            .setDescription(`Someone has reported a member of needing help.`)
            .addFields({name: 'Reporter', value: `<@${interaction.user.id}>`, inline: true})
            .addFields({name: 'Member', value: `<@${interaction.targetMessage.author.id}>`, inline: true})
            .addFields({name: 'Reported Content', value: interaction.targetMessage.content, inline: false})
            .setTimestamp()
            .setURL(interaction.targetMessage.url)
        let button1 = new ButtonBuilder()
            .setCustomId('emergencyThread')
            .setLabel('Contact')
            .setStyle(ButtonStyle.Primary)
        let button2 = new ButtonBuilder()
            .setCustomId('cancelEmergency')
            .setLabel('Clear')
            .setStyle(ButtonStyle.Secondary)
        let comp = new ActionRowBuilder()
            .addComponents(button1, button2)
        let newMsg = {content: `<@&${968896740382105611}>`, embeds: [modMsg], components: [comp]};
        modChannel.send(newMsg);

        await interaction.editReply({content: 'Thanks for notifying us. Please do not have conversation about cases like these: It is for our members\' privacy.', ephemeral: true});
    }
}
hardy nest
#

Your id there is a number

#
- `<@&${968896740382105611}>`
+ '<@&968896740382105611>'
coral glade
#

🤦

#

what was I doing haha

hardy nest
#

Being human