I get a error in discord that the bot don't response? how I can fix that
My code is comming
14 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 OPI can't answer, but correct me if I'm wrong, what I can see is that your regex is incorrect or does not match what you sent to the command.
???? öhm ok
yesterday I test it and it work well
I look on youtube and the ppl do it like me
So, it works if you pass an hashtag at the start with a string more than 3 characters long?
jup
u see my video?
By the looks of it, if you don't pass an hashtag at the start, it gets dropped to "invalid tag" section.
Yes, you didn't include the # in there.
first i test the regex and it is wrong and the second part I don't need test cause if the regex is wrong the tag doesn't exist
to respond to the error you're receiving directly, this is because you're not responding to the interaction
instead, you're just sending a message to the channel normally
it sounds like you're looking to use
interaction.reply()
instead of interaction.channel.send()
interaction.reply()
responds to the interaction by creating a new messageok I must switch this only in the exist and in the save part or in all 3
?
well you can only send one initial response to the interaction, and it needs to be within 3 seconds of the interaction being created
through the logic of your code, only one
send
should be executing (unless poor network conditions cause the "success" response to not resolve in time), so you could just replace each of them
however, upon further review of your code, I'd guess that client.getPlayer()
makes an api call
this could potentially take longer than 3 seconds depending on network conditions, so I'd actually suggest deferring with interaction.deferReply()
at the top of this function and instead replacing each send
with interaction.editReply()
ChatInputCommandInteraction#deferReply()
Defers the reply to this ChatInputCommandInteraction#editReply()
Edits a reply to this Slash Commands: Command response methods - Deferred responses
read more
ok I hope I understand all I sleep 2-3 hours cause it's too early and then I work and test my project
And the I can tell u if it's work or not tyyy