need help
I getting error when users connects in VC to early (Before Embed created and sended in channel)
Bot trying to update embed on VoiceStateUpdate, but he can't because emded with member stats creating little longer than VC
All works fine when i wait bot message before connect to VC
Error
LFG-Message.js (create embed and VC)
https://srcshare.io/6634b10aecdf3ead999ae523
LFG-Voice.js (Update embed on voiceStateUpdate)
https://srcshare.io/6634b14cecdf3ead999ae52b
5 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 OP[email protected]
node v20.11.1
im aslo trying to create closed channel, then update permissions
it successfully console.log ids but i still get error
LFG-Message.js
https://srcshare.io/6634b987c56cf36b82477a1a
Error
SrcShare
Easily share your source code with other developers.
Screenshot from LFG-Message.js Line 83-84
The only solution I have found is to create a closed channel and then open it ( after the bot sends embed )
But I couldn't do it
No, the only problem is that the bot is trying to update a non-existent message (because it takes half a second longer than the channel to create it).
Embed is created successfully and sent to the right channel, when I go to the voice channel the bot tries to update the Embed with my information.
Here is a video demo of the error
in first attempt all works fine, because i wait bot message before joining in VC, and bot successfully update embed
but in second attempt i join in VC right before bot message, then he tries to update message, but message doesent exist yet
I realize that my code may be unreadable, but
LFG-Message.js
im creating VC
then creating Embed
then sent embed in message.channel
then i save messageId and other event info in DB
LFG-Voice.js
Then onVoiceStateUpdate im find event info in DB by voiceChannel.id
Then find other info
Then create new emded
Then fetch message and update it with eventObejct (new Embed)