slash command: list with addMentionableOption

Hi, I would like to know if this is possible to give the ability to make a list of multiple mentionable input from a slash command.
4 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
Weac
Weac11mo ago
module.exports = {
data: new SlashCommandBuilder()
.setName('cta_warn')
.setDescription('Warn someone.')
.addMentionableOption(option =>
option.setName('user')
.setDescription('The user to warn.')
.setRequired(true)),
async execute(interaction) {
console.log(`[INFO] ` + interaction.id);
// interaction.user is the object representing the User who ran the command
// interaction.member is the GuildMember object, which represents the user in the specific guild
await interaction.reply(`${interaction.user} warned ${interaction.options.getMentionable('user')}`);
},
};
module.exports = {
data: new SlashCommandBuilder()
.setName('cta_warn')
.setDescription('Warn someone.')
.addMentionableOption(option =>
option.setName('user')
.setDescription('The user to warn.')
.setRequired(true)),
async execute(interaction) {
console.log(`[INFO] ` + interaction.id);
// interaction.user is the object representing the User who ran the command
// interaction.member is the GuildMember object, which represents the user in the specific guild
await interaction.reply(`${interaction.user} warned ${interaction.options.getMentionable('user')}`);
},
};
treble/luna
treble/luna11mo ago
You can only mention 1 entity with it Also, .addUser exists too because iirc addmentiontionable also includes channels
Weac
Weac11mo ago
Is their a part in the doc for restricting the whole bot commands for some roles on a server ?