Issues getting message after using it once
In the following screenshots you can see a summary of what i have been abl to find out until now.
- Bot starts, waits 30 minutes, gets message (ok)
- Bot waits 30 minutes, gets message (fail, crash)
67 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
THis is the basic structure this is in
What confuses me the most that it is able to get the message fine on start of the bot.
But when the second setInterval starts after 30 minutes it fails getting the message
The error that i got is saying that i cannot send an embed with just a color (no description). This happens because message.embeds[0] did not return anything
when i console.log message then i see that the embed is empty
i mean
you have to pass in a message id
its a form channel
channel id = message id
aaahh
alright
channel is conststently being called
thing is
first loop works
second one fails
no clue why
do you have the full error?
^ yes i do
ignore me doing if message.embeds, just soem debugging code
it fails here
it gets the embed via message.embeds[0] and puts it into an embed builder
then i adjust the color and send the edit
turning it red
tf am i seeing rn XD
its for a project to automatically report servers
QR / Phish / Oauth guilds.join abuse
ah hell nah
they switch vanities from server1 to server2
so i am tracking that
ye
and when that happens i just report the server
:)
200/mo~
poor discord getting swamped by tickets š
so you say that the embed description is needed?
yep, it complains as the get message embeds was not successful
it basically returned a message with no embed
if i check if it got the right message (comparing message id) it does indeed have an embed
it also is able to get it after after i restart the bot
but then never again until i do another restart
thats what can be seen here ^
so the discord.js lib says that the description is not required
still, the issue here is... where tf my embed at D: xd
hmm
idk
its a very weird behaviour
xD
also odd thing is... IT WORKS ON TESTING
BUT NOT ON PROD
AAA
so i have to test on prod each time D:
If i actually comment out the edit message it runs perfectly fine :P
:kekw:
i think i have some screenshot (termux on phone) which showed me doing that
but i did infact do that before and thats how i saw there is no embed
1s
after bot start: https://blackwolfwoof.com/s/wafX6R47TXw6zmD/preview
after running the second time https://blackwolfwoof.com/s/fCiQWE9JCDDnXFc/preview
this is not from cache btw, this is
const message = await channel.messages.fetch(channelID)
console.log(message)
did you try to use
message.embeds[0].data
when creating the updatedEmbed?that is not needed, nope i did not
thats when i try to use message.embeds[0] to create an embed using embedbuilder
you can pass the embed builder into an embeds: [here]
as a note, my code works.
Issue is only 50% of the time lol
only after it just rebooted
if it executes a second time it fails
fails on the message.edit right`?
yes
because it only has the edited color
as the get message embeds is empty
hmm, cache might be fricked then for some reason
anything in particular i should try to debug / show it?
also i have an old messy version in my backups which worked before i re-worked my code. If you want i can dig that up and show it in comparison
it will be messy code, be warned xd
uhh
latest, it builds the container new
i guess you can simply set the color of the embed in the message.embeds[0] thing
lemme see what package.json says
this just means higher version than X right?
or is this sufficient
you can also type
npm ls discord.js
in terminallemme spin up the bot
have you tried to set the color without using a seperate embedbuilder?
Nope
i doubt this iwll make any difference
i cannot get the embed
ah true
if i can't get the embed then it won't matter how i change the color
ye
it will just shat itself then xd
I guess one thing i can do is reinstall djs
and get latest
if that will help, no clue
npm i discord.js@latest
you don't have to uninstall it
time to docker build :P
i don't know why but i hate docker xD
lol
i have a hate love with it too ig
XD
especially with my nextcloud docker image
š
i am happy with my kvm server
also i hope my ratelimit is gone... i may or may not have made the time to small when testing :3
brb in 10~ minutes when i did 2 rounds in my code
nope, rate limited... a
still screaming at me in pain xd https://blackwolfwoof.com/s/42WDN8K98PpqqSD/preview
I will call it for today as idk how to fix this or what is wrong. I guess i will continue messaging here tomorrow after work if i have some time to look into it again
until then i will just comment out edit message i guess
gn š¤
Looks like that was it š, and i thought i coded in some bug š
https://blackwolfwoof.com/s/BxYXADJSxZtbBNA/preview
- shows caching behavior in requests
- successfully edits message embeds to red
Thanks a lot Qjuh š¤, i wouldn't have imagined djs having an issue which caused this