#Accessing GuildMemberRoleManager in TS

5 messages · Page 1 of 1 (latest)

opal musk

I'm having a little bit of confusion with accessing certain things with TS, I've been using it for a little while now but haven't quite been able to get my head around this.

GuildMember#roles returns string[] | GuildMemberRoleManager, I want to access the cache and run other manager specific methods. Is there a way other than an instanceof check to access the field as GuildMemberRoleManager?

sleek coveBOT
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
hoary sluiceBOT
abstract merlin

This is due to the fact that if the member came from a guild which isn't cached, then you only have access to the APIGuildMember

APIInteractionGuildMember to be more specific