Sending Embeds in correct order.
My bot is reading a file line by line and sending embeds with timestamps it gathers out of the file. Each channel.send() is awaited, but it seems to still not post in the correct order when it sends the messages in the channel.
20 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Then rl has if/else statements depending on the line
Wait, I may know the issue
Here's an example, I thought connected would've caused duplicate issues, but as long as if(){}else if() {} works the way I believe it does, it should be fine.
Here's a prime example:
Both of these lines go through the same code, but the time on the first message is after the second.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
If that was the case the whole thing wouldn't work
That doesn't happen with every message
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That helped the times. Thanks, now I have fields on an embed that aren't showing up when the message is sent though.
This is it + the fields in the terminal before it sends
Then it comes into discord like this:
It prints in the console when it adds fields and when it sends
Its sending after it adds fields..
Same way, just not async
Outer scope
I could probably use let, would it make a difference?
Could I make it a const if the fields & title could change multiple times?
I found the issue
Well I changed a few things, not entirely certain which one caused the issue, but changed a lot of vars to let, but what I think was causing it was after I sent the embed, I set the fields to [] again.
It was a redundant set to empty anyways since I do it in a line prior anyways.
Thanks for the help mate @qjuh
Do I just close the post, what's the typical action after?