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 docs3y 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
txjOP3y ago
it does exist when i eval but my types thing it doesnt exist? am i just being dumb here?
Jaworek
Jaworek3y ago
interaction.inCachedGuild()
txj
txjOP3y ago
oh thank you so much
d.js docs
d.js docs3y ago
method BaseInteraction#inCachedGuild() Indicates whether or not this interaction is both cached and received from a guild.
Jaworek
Jaworek3y ago
its a typeguard
txj
txjOP3y ago
thanks i need to be better about type guarding
Want results from more Discord servers?
Add your server