Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Member.Roles returns a string array #137

Closed
RickvanLoo opened this issue Feb 27, 2016 · 3 comments
Closed

Type Member.Roles returns a string array #137

RickvanLoo opened this issue Feb 27, 2016 · 3 comments
Milestone

Comments

@RickvanLoo
Copy link

Currently the struct Member has a field 'Roles' that returns type []string
I think the return of type []Role would be better here, or is there an API limitation that prevents this?

@iopred
Copy link
Collaborator

iopred commented Feb 27, 2016

This is what the API returns. It's a list of role ID's you need to actually grab the roles from

s.State.Guild(guildID).Roles

@RickvanLoo
Copy link
Author

Thank you!

//offtopic
But that means that the official client has to check for every message the roles in its state. That's looks not very efficient, or it is some ReactJS state magic :-)

@iopred
Copy link
Collaborator

iopred commented Feb 27, 2016

They probably put the roles in the equivalent of a map[string]*Role, very efficient to grab a role that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants