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

No way to step through Guild_Array/Channel_Array besides forEach #77

Open
Ryu945 opened this issue Feb 19, 2017 · 3 comments
Open

No way to step through Guild_Array/Channel_Array besides forEach #77

Ryu945 opened this issue Feb 19, 2017 · 3 comments

Comments

@Ryu945
Copy link

Ryu945 commented Feb 19, 2017

There is no way to step through those IGuildCollection/IChannelCollection besides using forEach which you can't use in all coding situations. For example, you can't denote them with [i] for i = 1 to 50 or anything like that.

@Ryu945
Copy link
Author

Ryu945 commented Feb 21, 2017

I ended up making a function like this to get around the problem.

function guild_selector(guilds, index) {
	var ID = guilds.toArray()[index].id;
	var guild = guilds.get(ID);
	return guild;
}

@drdrjojo
Copy link
Contributor

It doesn't make sense to go by indexes, when a guild because unavailable.
You should go by id and access them directly over guild.get(id).

@Ryu945
Copy link
Author

Ryu945 commented Feb 25, 2017

This is if you want to going through a guild on the list but do not want to go through them all. Just the very next one.

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

2 participants