Async not working

when I write this code it shows a red underline underneath it
4 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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
! MYA
! MYAOP3mo ago
const { PermissionsBitField , SlashCommandBuilder , EmbedBuilder } = require("discord.js")

module.exports = {
data: new SlashCommandBuilder()
.setName("Warn")
.setDescription("Warns a member")
.addUserOption(option => option.setName("User").setRequired(true))
.addStringOption(option => option.setName("Reason").setRequired(false))

async execute(interaction) {
interaction.reply("Hi")
}
}
const { PermissionsBitField , SlashCommandBuilder , EmbedBuilder } = require("discord.js")

module.exports = {
data: new SlashCommandBuilder()
.setName("Warn")
.setDescription("Warns a member")
.addUserOption(option => option.setName("User").setRequired(true))
.addStringOption(option => option.setName("Reason").setRequired(false))

async execute(interaction) {
interaction.reply("Hi")
}
}
the word easync async* has a red underline under it
Syjalo
Syjalo3mo ago
You have a syntax error. You forgot a comma in your object after your data property
! MYA
! MYAOP3mo ago
oh cheers it worked thx
Want results from more Discord servers?
Add your server