42 Replies
- 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 staffwhat is the error
okay so you are handling the error, that doesnt really help, can you show the code where that string is sent? check in your ban command script
you are handling the error but are you printing it to the console?
There is no error in the console, the bot just doesn’t respond
look into your ban script
send it if you can, its failing somewhere there. if you are using a try catch then log the error to the console, dont ignore it
what does it mean
i do not understand
I can't help you if you are not providing any code
debugging is a fundamental part of programming, also
you have to understand your code, im telling you that somewhere in your ban command script or whatever code you execute when the command code is ran is throwing an error
apparently you are handling that error in your code because the bot is actually replying, but its not executing the command. If the console doesn't log anything when this happens that means you are not logging the error wherever you are handling it
that is as much as I can help without seeing any of your code
its full code ban script
alone start
I run other commands using the code from here https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
show your main script
below is the moment that responds in case of command error
yea although there is a console.error(error) there but you said nothing is getting logged to the console when the code throws the error
are you sure about that
trigger the command, if it errors then check the console
copy and paste whatever shows up on it
this code
when I run main.js it also gives a good response
thats the deploy script
im talking about running your bot
then doing /ban so it errors and gets logged to the console
alright now trigger the command
do /ban
the application is not responding:Thonkang:
wow
now again "There was an error while executing this command!
"
okay and the console?
the error you are getting (aside from what kin said) is that you are passing an avatar hash to the
embedBuilder.setImage()
instead of an url
use interaction.user.displayAvatarURL()
instead to set the embed imageonly if you delete this text, it work
it shouldn't really work if you didn't fix what kin also said
why?
because
{embed}
would make .send({embed: embedBuilder})
which would not send the embed with the message
the property is embeds
and it takes an array of embeds
i mean Kin sent you the examplebut i use
.setImage(${interaction.user.displayAvatarURL})
inside embedthat is not what im talking about
but anyway, if it works now then there you go
await interaction.reply({ embeds: [embed] });
i did
anyway errorshow it
error?
yea
it says you are passing this
'displayAvatarURL(options) {\n return this.avatarURL(options) ?? this.defaultAvatarURL;\n }'
entire thing to setImage
what did you change in your codeso?
show your code again
your ban script
its a method
you have to call it
fine
all work
thanks