module.exports = {
data: new SlashCommandBuilder()
.setName('staffmember')
.setDescription('tee')
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
const tagName = interaction.guild.roles.fetch('1224381394428498063')
.then(role => role.members)
.catch(console.error);
await console.log(tagName);
const tagDescription = interaction.user;
try {
// equivalent to: INSERT INTO tags (name, description, username) values (?, ?, ?);
const tag = await interaction.client.Tags.create({
name: '1',
description: '1',
username: interaction.user.id,
});
return interaction.reply(`Tag ${tag.name} added.`);
}
catch (error) {
if (error.name === 'SequelizeUniqueConstraintError') {
return interaction.reply('That tag already exists.');
}
console.log(error)
return interaction.reply('Something went wrong with adding a tag.');
}},
};```
#console shows promise pending
13 messages · Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
✅Marked as resolved by OP
well... await the promise
i know where is the mistake
where you're fetching the guild role
i just want console log the array of members
but await can't handle it
in my guild