TypeError: Canot Read property `get` of undefinded

Hi i have error TypeError: Canot Read property get of undefinded

My code with error:

  let channel = client.channels.cache.get(CHANNEL) || await client.channels.fetch(CHANNEL)
  if(!channel) return;

  const connection = await channel.join()
}, 20000)


Someone help?

Your code is attempting to access the client.channels.cache prior to your having logged in.

This may not be true, we are not shown the entire function this code is inside of, it seems to be some setTimeout/Interval?

I can accept that… the cache property is likely null at that moment.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.