Monday, 5 June 2017

JSON reference array by name rather than index

Okay so I'm working with some JSON data: https://raw.githubusercontent.com/hydrabolt/discord.js/docs/stable.json and I am looking in classes. However I want the user for my bot to enter what they need so for example if they wanted to view the GuildMember class and the 1st method (who's name is hasPermission) the path to that is classes[33].methods[1].name.

I don't want the user to remember each number that represents the value they want. For example I would want classes["GuildMember"].methods["hasPermission"] or something along those lines.



via Rusty

No comments:

Post a Comment