I am new to JavaScript, am I was trying to dissect an embedded message. Here\'s my code, it runs fine for a few mins, works accordingly but idk what goes wrong.
Probably some of the embed object is coming without the title property.
embed
title
You can safely use your logic changing your if condition to:
if ('title' in message.embeds[i] && message.embeds[i].title.includes("text!")) { /* ... */ }