skip to navigation
skip to content

Clashogram 0.1.22

Clash of Clans war moniting for telegram channels.

.. contents::
:depth: 3

clashogram |Build Status| |Build status| |Pypi status|

Clash of Clans war moniting for telegram channels.

NOTE: Clash of Clans API data is always 10 minutes behind the game
events. This is not a bug in this program.

``clashogram`` monitors your clan's warlog and posts the following
messages to a Telegram channel:

1. Preparation started (with clans and players information)
2. War started
3. New attacks (with details)
4. War over


To run the program you need to have python 3.3 or higher. You will also
need ``pip`` to install python dependencies. Moreover, using a
`virtualenv <https:"" en="" stable=""/>`__ makes
installation much easier, otherwise you have to install everything
system-wide. On Linux you would need to run commands with ``sudo``, on
windows with administrator account.


From pypi:


pip install clashogram

From Github:


git clone
cd clashogram
install -r requirements.txt
python install


In order to use the program do the following:

1. Open a Clash of Clans developer account at
2. Find your external IP address using a website like
`this <https:""/>`__.
3. Go to your CoC developer page and create an API token for the IP
number you just found.
4. Create a Telegram bot using BotFather and copy its token.
5. Create a new Telegram group and add the bot you just created as an
administrator to that group.

Now you can run the following command:


pip install clashogram --coc-token <coc_api_token> --clan-tag <clan_tag> --bot-token <telegram_bot_token> --channel-name <telegram_channel_name>

In order to have messages in a different locale do the following and
then run the program:


export LANGUAGE=<language_code>
export LANGUAGE=fa

Or do it in one step:


LANGUAGE=fa --coc-token <coc_api_token> --clan-tag <clan_tag> --bot-token <telegram_bot_token> --channel-name <telegram_channel_name>

Run as a service

The simplest way to use Clashogram is leave it running in background
using either `byobu <>`__ or `GNU
Screen <https:"" software="" screen=""/>`__. Another solution is to
install a systemd unit:


Description=Clashogram Daemon

ExecStart=/path/to/python /path/to/


Search internet for more information on installing systemd units on your

Contribution (PRs welcome!)

The Telegram notification is isolated from the rest of the program. You
can replace it with anything else to have your messages sent to
somewhere else.

Fork and clone the repository and send a PR. Make sure tests pass


python -m unittest discover

Or with ``py.test``:


pip install pytest


In order toadd or update a new language catalog do the following:


python init_catalog -l <language_code>
python update_catalog -l <language_code>

For example:


python init_catalog -l fa
python update_catalog -l fa

In case of adding new messages extract them and compile again:


python extract_messages
python compile_catalog

For more information on internationalization see
`Babel <http:"" en="" latest="" setup.html="">`__.

Thanks Ali Ayatollahi and other members from IRAN clan (tag #YVL0C8UY) for the initial idea and testing.



.. |Build Status| image::
.. |Build status| image::
.. |Pypi status| image::

.. raw:: html

<div dir="rtl">
<h3>راهنمای فارسی</h3>
برای مطالعه راهنمای فارسی به <a href="">این آدرس</a> سر بزنید.
File Type Py Version Uploaded on Size
Clashogram-0.1.22-py3.6.egg (md5) Python Egg 3.6 2018-01-23 24KB
Clashogram-0.1.22.tar.gz (md5) Source 2017-10-20 11KB