Weac
Weac
DIAdiscord.js - Imagine an app
Created by Weac on 7/18/2023 in #djs-questions
Managing roles with name/id
But I find an id only from this console log, which is what I want, but I cannot get the id of my role to compare
12 replies
DIAdiscord.js - Imagine an app
Created by Weac on 7/18/2023 in #djs-questions
Managing roles with name/id
To add more context : I am getting my role through the interaction of user, I would like to compare it to the roles "Off..."
console.log(interaction.member._roles);
console.log(interaction.member._roles);
12 replies
DIAdiscord.js - Imagine an app
Created by Weac on 7/18/2023 in #djs-questions
Managing roles with name/id
I must be missing something do you have a link to the doc of it ?
12 replies
DIAdiscord.js - Imagine an app
Created by Weac on 7/18/2023 in #djs-questions
slash command: list with addMentionableOption
Is their a part in the doc for restricting the whole bot commands for some roles on a server ?
6 replies
DIAdiscord.js - Imagine an app
Created by Weac on 7/18/2023 in #djs-questions
slash command: list with addMentionableOption
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')}`);
},
};
6 replies