# Telegram bot for GemsOfWar

**URL:** <https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032>\
**Category:** Community Guides\
**Created:** [September 28, 2016, 9:22am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032 "2016-09-28T09:22:05Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [September 24, 2017, 7:47am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/42 "2017-09-24T07:47:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [September 24, 2017, 11:03am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/43 "2017-09-24T11:03:47Z")

</div>

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)](https://us1.discourse-cdn.com/flex019/uploads/gemsofwar/original/3X/1/c/1c5c5f6a761aac69275f9dd09e8ff3f589a65b02.jpg)

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [September 24, 2017, 11:06am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/44 "2017-09-24T11:06:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [September 24, 2017, 2:29pm UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/45 "2017-09-24T14:29:08Z")

</div>

**Kingdoms**  
[http://gowdb.com/api/kingdoms](http://gowdb.com/api/kingdoms)  
[http://gowdb.com/api/kingdoms/3009/details](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/es-ES/api/troops/6167/details)  
[http://gowdb.com/fr-FR/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/de-DE/api/troops/6167/details)  
[http://gowdb.com/it-IT/api/troops/6167/details](http://gowdb.com/it-IT/api/troops/6167/details)  
[http://gowdb.com/ru-RU/api/troops/6167/details](http://gowdb.com/ru-RU/api/troops/6167/details)

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [October 1, 2017, 3:27am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/46 "2017-10-01T03:27:31Z")

</div>

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

```json
{"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"}

```

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 1, 2017, 3:34am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/47 "2017-10-01T03:34:00Z")

</div>

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

```auto
[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
}

```

---

<div class="post-metadata">

**Author:** ![Taransworld](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/taransworld/32/17324_2.png) [@Taransworld](https://community.gemsofwar.com/u/Taransworld)\
**Post date:** [October 10, 2017, 8:00am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/48 "2017-10-10T08:00:10Z")

</div>

Hi, Lyya,

Quick question. Is there a [http://gowdb.com/api/kingdoms/details](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. 🙂

Taran.

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 10, 2017, 8:24am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/49 "2017-10-10T08:24:35Z")

</div>

Hi Taran,

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

Lyya

---

<div class="post-metadata">

**Author:** ![Taransworld](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/taransworld/32/17324_2.png) [@Taransworld](https://community.gemsofwar.com/u/Taransworld)\
**Post date:** [October 10, 2017, 1:33pm UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/50 "2017-10-10T13:33:24Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 12, 2017, 5:42am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/51 "2017-10-12T05:42:43Z")

</div>

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](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.

```plaintext
{
    "troops": [{"id":"troop1", ...}, {"id":"troop2", ...}],
    "modTime": modTime
}

```

@Taransworld, @jmjeong

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [October 12, 2017, 7:38am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/52 "2017-10-12T07:38:17Z")

</div>

> [@Lyya](#):
>
> [http://gowdb.com/api/kingdoms/details](http://gowdb.com/api/kingdoms/details).

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

[http://gowdb.com/api/weapons/details](http://gowdb.com/api/weapons/details)

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 12, 2017, 7:44am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/53 "2017-10-12T07:44:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Taransworld](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/taransworld/32/17324_2.png) [@Taransworld](https://community.gemsofwar.com/u/Taransworld)\
**Post date:** [October 12, 2017, 2:43pm UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/54 "2017-10-12T14:43:45Z")

</div>

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

Take care and thanks again!

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

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [October 25, 2017, 12:44am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/55 "2017-10-25T00:44:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 25, 2017, 12:56am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/56 "2017-10-25T00:56:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 25, 2017, 2:10am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/57 "2017-10-25T02:10:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [October 26, 2017, 7:15am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/58 "2017-10-26T07:15:29Z")

</div>

I changed [@gemsofwar\_bot](http://telegram.me/gemsofwar_bot) to use gowdb official(?) api.  
It fetches the gowdb api twice a day (8:58am, 20:58pm).

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 28, 2017, 4:52am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/59 "2017-10-28T04:52:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmjeong](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/jmjeong/32/11255_2.png) [@jmjeong](https://community.gemsofwar.com/u/jmjeong)\
**Post date:** [October 29, 2017, 2:48am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/60 "2017-10-29T02:48:28Z")

</div>

Thank you.

Can you provide the user information via API? In [gowdb.com](http://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)](https://us1.discourse-cdn.com/flex019/uploads/gemsofwar/original/3X/f/9/f98eaeb3f5b2d8b1020b5745eec33ca9b840074a.png)

---

<div class="post-metadata">

**Author:** ![Lyya](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/lyya/32/3650_2.png) [@Lyya](https://community.gemsofwar.com/u/Lyya)\
**Post date:** [October 29, 2017, 3:44am UTC](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032/61 "2017-10-29T03:44:16Z")

</div>

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

[Previous page](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032.md?page=2)

[Next page](https://community.gemsofwar.com/t/telegram-bot-for-gemsofwar/13032.md?page=4)
