Missing cache on bot, but works from Eval

Seems interaction.member?.roles.cache does not exist for me, but I can eval it, is this related to my types being wrong? https://l.txj-dev.xyz/D7Z3Y
8 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
txj
txj2y ago
it does exist when i eval but my types thing it doesnt exist? am i just being dumb here?
Jaworek
Jaworek2y ago
interaction.inCachedGuild()
txj
txj2y ago
oh thank you so much
d.js docs
d.js docs2y ago
method BaseInteraction#inCachedGuild() Indicates whether or not this interaction is both cached and received from a guild.
Jaworek
Jaworek2y ago
its a typeguard
txj
txj2y ago
thanks i need to be better about type guarding