Typeerror: Cannot read Property 'message' of Undefined

Asked

Viewed 431 times

0

I am trying to create a code for on a particular channel when a message is identified, two Emojis are immediately added to that message, but in the messages on that specific channel.

I’ve tried several ways, like creating variables to try to distort and change but always the same thing.

let canal = client.channels.get("603948500765507598")
if (canal.message.content === '') {
    message.react('');
    message.react('');
}
  • What is the value of canal? View through the console or debug tools.

  • client.channels.get("603948500765507598") is returning undefined, check that this number is correct, that might be it. Which api/library/framework is using?

  • I also thought that was it, but I tried to switch with another channel and get the id, and gave anyway, I use Node.js/Discord.js

  • And what is the return of the function get as documented?

  • I’m not sure, about get the return console, if you have anything related in the documentation I’m not aware of, I’m still "beginner" in that area.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.