64 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!and what is your issue
im sending 2 embeds
im tryign to edit embed 2 with
consoleembed2
@wolvinny đyou have to resolve the message you just sent into a variable and call edit on that
how
can i
resolve the message into a variable
or wait
idk how @wolvinny đ
m = message.channel.send({ embeds: [consoleembed] });
m
wait(2000);
message.edit({ embeds: [consoleembed2] });
}
can you not ping me in every reply
mb
Resources to understand Promise:
- MDN: learn more
- Guide: learn more
- JavaScript info: learn more
you should really understand how promises work
can u not just tell me how in this context?>
No. You need a solid understanding of js
i do
Just helping you without understanding isnt gonna work
just not with editing messages
then you should know how promises work
.send returns a promise
that resolves into a Message
On which you can call .edit
i just dont know hjow to use the .edit to specific message
message.edit({ message});
where would the message im aiming go at
again
<TextChannel>.send returns a promise that resolves into a Message
On which you can call .edit
i still cant
tried everything u said
m= message.channel.send({ embeds: [exampleEmbed] });
m wait(2000); m.edit({ embeds: [consoleembed2] }); message.channel.send({ embeds: [exampleEmbed] }); wait(2000); message.edit({ embeds: [consoleembed2] });
m wait(2000); m.edit({ embeds: [consoleembed2] }); message.channel.send({ embeds: [exampleEmbed] }); wait(2000); message.edit({ embeds: [consoleembed2] });
It returns a Promise
doesnt?
It does
DiscordAPIError[50005]: Cannot edit a message authored by another user
Well yeah
nvm i get this now
Thats because you're trying to edit the message se't by the user
how do i edit the specfic embed 2
I would recommend to read this
i did
can you not just give me the code
i tried everything
idek
can u not just give me a sample code
example or edit mine
Yeah no
Put some effort in and read the tag
and read #rules 3
Donât expect people to spoon feed you code, if you dont understand something, look it up and gather some knowledge.
ive been doing that for over an hour thats why i opened the ticket
ik how to edit a message not send multiple embeds and edit 1 one of them only
you have to store the result from .send in a message
which returns a promise so handle it
alr ill try again
nthn is working ill just not use that feature
spent too long on it and couldnt make it work
maybe actually try to understand how promises work
Nothing is gonna work if you dont know them
Its basic js
Nothing is working because you donât have enough knowledge of javascript to understand whatâs wrong
exactly thats why im asking u guys for it
#resources
i swear i tried too confusing
they're key to be able to work with djs and js in general
So you'll somehow have to figure out a way
thats the last resource i'll give
We arenât your teachers, we are random people who know how javascript works, look up âlearn javascriptâ and try to get some knowledge
more resources can be found in #resources
idr need to learn it since my bot is just a handler for my fn bot i just needed the simple code on how to edit or a example but it took too long
Nope
im not trying to learn js i alr know a bit
Well you need to
Your going to get know where if you donât know what your doing
i did that with python for close to 2 years and im good at it now
Well python isnât javascript
They are two totally different languages
yea but i learnt alot in java while making my fn lobby skin changer
Java also isnt javascript
i said js
i meant js
Ok then this shouldnât be very hard
Whatâs a promise
idk i legit said i only know a ibt
bit
never used it while making my bot
Once again, promises are necessary to learning js
And discord js
yea but id learn if i had a sample code
Look it up then
this is going nowhere. Please take the time to learn promises, i gave you enough resources
if you still have issues after that you can come back
But learn promises first
all solutions for editing is 1 message or 2 i have multiple
alr thanks wolv
No. Look up how promises work. Iâm not arguing with you anymore, this is a complete waste of our times
Donât ping me
never did g
Just donât ping me anymore
didnt ping g