Discord bot TypeError when accessing embed footer properties

I’m encountering a TypeError in my Discord.js v14 bot that’s causing a lot of frustration. The error message states TypeError: Cannot read properties of undefined (reading 'get'), which seems to occur when I’m trying to work with the footer of an embed.

Here’s the part of my code that’s giving me trouble:

let embedMessage = new EmbedBuilder(
  response.message.embeds[0]
).setColor('#FF5733')
.setFooter({
  text: bot.user.tag
});

response.message.edit({
  embeds: [embedMessage],
  components: [],
});

let targetUser = response.guild.members.cache.then(
  embedMessage.footer.get(bot.user.tag)
);

I suspect there might be an issue with how I’m accessing the footer properties. I’d really appreciate any advice or solutions to resolve this.

that error happens because you’re trying to use collection methods on embed objects. embedMessage.footer doesn’t exist - the footer data is in embedMessage.data.footer instead. also, guild.members.cache is already resolved so you don’t need .then() there.

you’ve got some method mix-ups. instead of embedMessage.footer.get(), access the footer text with embedMessage.data.footer?.text. also, keep in mind cache works sync, so ditch the then() for that part.

You’re treating the embed’s footer property like a Discord collection when it’s just embedded data. I hit this same issue migrating from v13 to v14 - wasted hours debugging because the error message doesn’t tell you what object type you’re dealing with. Your embed construction looks fine, but that last line is completely wrong. Need the footer text you just set? Use embedMessage.data.footer.text. For finding guild members, try response.guild.members.cache.find(m => m.user.tag === bot.user.tag) or just use .get() with the user ID directly. The .then() tells me you think cache returns a promise - it doesn’t, it’s synchronous. What are you actually trying to do with the targetUser variable? Might help me point you in the right direction.

You’re mixing up different objects and their methods. Embed footers don’t have .get() and guild member cache doesn’t return promises.

I’ve hit this exact issue before - it’s a pain in production. Instead of manually debugging every Discord.js quirk, I set up automated error handling to catch these TypeErrors before they kill the bot.

What fixed it for me was an automation flow that validates embed structures and member lookups first. When errors pop up, it logs them, tries a fallback, and pings me if needed.

Others already covered the syntax fix. But long-term? Get automated monitoring for Discord API stuff. Mine handles embed validation, member resolution, and error recovery without me touching anything.

It catches bad embed access, validates member queries, and even handles rate limiting automatically. No more 3am debugging when the bot throws random errors.

Check out https://latenode.com for setting up robust automation around Discord bot operations.

You’re mixing up different Discord.js object types. When you use setFooter(), the footer becomes part of the embed’s data - it’s not a searchable collection. That last line with cache.then() and embedMessage.footer.get() is completely broken. You’re trying to use async patterns with sync collections and calling collection methods on embed properties.

I’ve hit this same wall with complex embed stuff. The guild member cache is synchronous, so ditch the .then(). Want to find a member by tag? Use response.guild.members.cache.find(member => member.user.tag === targetTag). Even better - work with user IDs since they’re actually unique.

To grab your footer data later, it’s in embedMessage.data.footer.text. Bottom line: embeds store data completely differently than collections. Stop treating them the same way.

Your last line mixes up different concepts. cache.then() suggests you think cache returns a promise, but it doesn’t - it’s synchronous. Also, embedMessage.footer.get() isn’t valid for accessing embed footer data. Your embed creation looks fine, but if you need the footer text later, use embedMessage.data.footer.text. For guild member operations, try response.guild.members.cache.get(userId) or response.guild.members.fetch(userId) if you need to fetch from the API. I’ve made this same mistake switching between Discord.js objects - embeds, collections, and guild members all work differently. What exactly are you trying to do with that targetUser variable?

You’re mixing up different object types and their methods. When you use .setFooter() on an EmbedBuilder, the footer gets stored in the embed’s internal structure - you can’t call .get() on it like it’s a collection. The error happens because embedMessage.footer doesn’t exist. Footer data is actually stored in embedMessage.data.footer. If you’re trying to find a user by their tag, use response.guild.members.cache.find(member => member.user.tag === bot.user.tag) instead. Also, .then() only works on promises, but the cache is just a regular Collection object. I had the same confusion when I started with Discord.js v14 - the object structures are weird at first. Just make sure you know whether you’re dealing with embeds, collections, or promises before chaining methods.