Closed HZooly closed 6 years ago
Of course! 😄
@martincarrera thanks! I'll continue to integrate my bot using some endpoints of your API.
Remark: I did would to get idNames
of chests, store them in a variables, and make random HTTP call for getting random image of chest.
But it's impossible because /chests
returns idNames like wood-chest-1
. The part -1 is unavailable in images.
You are right.
Try this before getting the image: chest.replace(/-([0-9999])+/, '')
.
This way you remove the -1
part.
Yep, right :-)
For being more accurate with random, I decided to store names like that:
let chestIDs = [
"wooden-chest",
"silver-chest",
"golden-chest",
"crown-chest",
"magical-chest",
"giant-chest",
"super-magical-chest",
"epic-chest",
"legendary-chest",
"lightning-chest",
"fortune-chest",
"kings-chest"
];
Because current API returns few times wood-chests (and some others).
Maybe implement a new endpoint for getting element randomly? For images & items.
Hey!
May I suggest this bot. It's using CR-API and ClashRoyale-API for getting images.