#Why ii.channel.send(...) gives me a undefined but when console.log() shows everything is okay

64 messages · Page 1 of 1 (latest)

hasty sorrel
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

cobalt flame
#

which channel.send?

hasty sorrel
cobalt flame
#

but u re not logging it?

hasty sorrel
#

I am

cobalt flame
#

where?

hasty sorrel
#

check line 140, 86, 130

topaz harness
#

channel.send return a promise

hasty sorrel
#

so what I have to do?

cobalt flame
#

and isSelectMenu**()** is a fuction

topaz harness
hasty sorrel
cobalt flame
hasty sorrel
cobalt flame
#

ta

topaz harness
hasty sorrel
#

cuz it returns "undefined undefined undefined"

cobalt flame
#

so toExchange , toReceive , amount are undefined

hasty sorrel
#

but Im setting their value and in console.log() it shows that value

#

but in sending message to channel it returns undefined

#

dobra po polsku bedzie lepiej mi to wytlumaczyc tobie

#

ustawiam normalnie ich wartosc i jak daje console.log to normalnie wszystko sie wyswietla w konsoli

#

ale jak probuje wyslac na kanal to wtedy pokazuje undefined

#

@cobalt flame

#

sorki za ping

hasty sorrel
topaz harness
hasty sorrel
#

english is difficult for me, sorry xD

topaz harness
#

You just declare it

#

Never assigning

hasty sorrel
#

i asign it in lines: 87, 131 and 141

topaz harness
#

No

hasty sorrel
#

and when I console.log toExchange, toReceive and amount it shows everything in console

#

only in channel.send it shows undefined

topaz harness
#

I can't find any console.log of toExchange, toReceive or amount

hasty sorrel
#

line 86

#

line 130

#

line 140

topaz harness
#

Send me your lines please

hasty sorrel
#

that is line 86: console.log(c.values) that is line 130: console.log(c.values) and that is line 140: console.log(collected)

topaz harness
#

Ok so where did you see "toExchange", "toReceive" or "amount" ?

hasty sorrel
#

okay im gonna replace it, wait

#

now the whole command doesnt work

#

"Interaction failed"

topaz harness
#

I think you don't understand

#

You declared 3 variables : toExchange, to Receive and amount at line 29-31 ok?

hasty sorrel
#

I understand what you said to me, so i tried to change console.logs to "toExchange", "toReceive" and "amount"

topaz harness
#

You never assigned it

hasty sorrel
#

cuz I asigned value to it

topaz harness
#

Nowhere

#

Only in your mind

hasty sorrel
topaz harness
#

=== is if operator

hasty sorrel
#

oh

topaz harness
#

Not assignment

hasty sorrel
#

bruh

#

sorry

#

im dumb