Telegram bot for GemsOfWar

Ah, I see. Well, unfortunately, I don’t have that information available at the moment. I have the facility to track modification time for individual troops, spells, etc. but it’s not enabled; for now you can use the mod time to tell if you can skip things entirely, which should give you most of the win you’re looking for.

I’ll investigate what it would take to satisfy your request later this week, though.

2 Likes

Is there any kingdom API?

To display the following information, it is necessary to have kingdom information.

Screenshot of Telegram Desktop (24-09-2017, 8-02-46 PM)

It will be good to have the localization API for supporting Spanish version which @Chuca wants.

Kingdoms
http://gowdb.com/api/kingdoms
http://gowdb.com/api/kingdoms/3009/details

Localization
Just add the language code before “api,” as in the following:
http://gowdb.com/es-ES/api/troops/6167/details
http://gowdb.com/fr-FR/api/troops/6167/details
http://gowdb.com/de-DE/api/troops/6167/details
http://gowdb.com/it-IT/api/troops/6167/details
http://gowdb.com/ru-RU/api/troops/6167/details

2 Likes

Lyya, is there any mapping API for “colors”, and “rarityId” field?
There seems that 1024 is ‘blue’.

{"0":{"id":6000,"name":"Ogre","rarity":"Common","kingdomId":3000,"type":"Giant","colors":1024,"spellId":7131,"description":"Nothing says \"Don't mess with me\" quite like a necklace of your enemies' skulls.","rarityId":1,"typeCode1":"giant","typeCode2":"","maxArmor":14,"maxLife":30,"maxAttack":19,"maxMagic":0,"kingdomName":"Broken Spire","imageUrl":"http://gowdb.com/assets/cards/Troop_K00_00.jpg","pageUrl":"http://gowdb.com/troops/6000"}

Ah, sorry. Yes, here are the mappings. Note that GemColor is often a bitmask of several values OR’d together.

[Flags]
public enum GemColor
{
    Blue = 0x400,
    Green = 0x100,
    Red = 0x040,
    Yellow = 0x010,
    Purple = 0x004,
    Brown = 0x001
}

public enum Rarity
{
    Common = 1,
    Rare = 2,
    UltraRare = 3,
    Epic = 4,
    Legendary = 5,
    Mythic = 6
}
3 Likes

Hi, Lyya,

Quick question. Is there a http://gowdb.com/api/kingdoms/details (like troops has) that have all the details of all the Kindoms so I don’t have to pull each kingdom to get details?

As always, thank you so much for all you do for the community. :slight_smile:

Taran.

Hi Taran,

No, sadly there is not, but I could probably make you one this week if you like.

Lyya

4 Likes

That would be really awesome if you could do that. I’m working on a bot and would like to only pull the JSON data once a day (if needed) from your site. Pulling and searching through one file would make my bot so much more efficient then opening 29(?) files.

Thank you so much in advance. :slight_smile:

I Okay, a couple updates (since I have no “official GoWDB API thread”):

  • Added a all kingdom details endpoint, at http://gowdb.com/api/kingdoms/details.
  • The addition of “modTime” broke my “all” queries, which had previously all been indexed arrays (square bracket notation in JSON) by introducing a string property at the top level. So I’ve changed all the “all” APIs to return data in the following form (replacing “troops” with whatever the query is). This is a breaking change.
{
    "troops": [{"id":"troop1", ...}, {"id":"troop2",  ...}],
    "modTime": modTime
}

@Taransworld, @jmjeong

3 Likes

It will be great to provide the following api to reduce pull rate, too.

http://gowdb.com/api/weapons/details

Why did I expect this would be next? :slight_smile:
Yes, stay tuned, I’ll add this as well.

2 Likes

Thank you very, very much for this change @Lyya. I’m looking forward to getting this in to my bot today. :smiley:

Take care and thanks again!

One of the websites I have written using your JSON data:
http://www.taransworld.com/chest/

1 Like

@Lyya http://gowdb.com/api/spells does not work today. Please check it.

Yup, confirmed. I’ll take a look when I’m not mobile. Sorry for the inconvenience!

Should be fixed. Sorry about that. (It appears I sneezed into a text editor or something…how embarrassing!)

I changed @gemsofwar_bot to use gowdb official(?) api.
It fetches the gowdb api twice a day (8:58am, 20:58pm).

Sorry for the delay on this, @jmjeong. I’ve added http://gowdb.com/api/weapons/details today. Let me know if there are any more APIs you need.

Thank you.

Can you provide the user information via API? In gowdb.com Settings page, users can select if their information can be shown in ladder and Statistics page. How about adding API option and providing their information via API?

I want to see my TraitsStone information via telegram bot.

Screenshot of Chrome (29-10-2017, 11-32-48 AM)

That’s an interesting idea. I will consider it.

2 Likes