channel.send() is not a function
Why is it randomly saying this is not a function. It was working an hour ago π
24 Replies
what is channel?
would need to see the rest of that line
Channel is a channel created by a command
(ModMail system)
can u show rest of line?
Just
.then()
what is before then
nah thats enough to say why this is wrong
Like I said, it worked earlier today
By chaining a second
.then
what you get is the return value of the first .then
Which is a message, not a channelso how would I fix this
return chanel in first then
Dont shadow the
channel
variable, or just dont use multiple thens
This is where async/await starts to become a much nicer syntax
Your final third .then is wrong too
Not a callback method
You could do .then(message => message.channel.send
in the middle oneI moved the final
.then
to a better place
but how do I fix the other thing
It wont let mejust use await
What would that do to return it
Resources to understand Promise:
β’ MDN: learn more
β’ Guide: learn more
β’ JavaScript info: learn more
I said how
Literally this
It returns a message so treat it like a message
Okay
Putting them in a single
.then
does this
Okso its working
Yes
Thanks for the help π
I'm sorta new to this