I recently noticed that my discordbot stopped working, I haven't upgraded anything on my server and it just stopped working.
I noticed in the logs. Figured I had old versions of packages and I upgraded to discord.js v13 and everything borked even more.
discclient.channels.fetch(item.channel[i]).send(msgembed)
Now i'm stuck here.
index2.js:46
channel.send({ embeds: [msgembed] });
^
TypeError: Cannot read properties of undefined (reading 'send')
Anyone got an idea? Have they changed alot of stuff?
Thank you!
GuildChannelManager#fetch() returns a promise, you have to resolve it before trying to access the channel.
discclient.channels.fetch(item.channel[i])
.then(channel => channel.send({ embeds: [msgembed] }))
.catch(console.error);
This simply means that the channel doesn't exist. Try fetching and verifying if it found it, before sending the message.