Skip to content

Commit

Permalink
Add alternate method to get Telegram chat ID
Browse files Browse the repository at this point in the history
This commit updates the docs to suggest an easier way of getting the
Telegram chat ID. `@getidsbot` is a pretty handy bot and admittedly, it
is a much easier way to get the Telegram chat ID. 😅

Closes #237.

Signed-off-by: Justin W. Flory <git@jwf.io>

Co-authored-by: Tim Zabel <Tjzabel21@gmail.com>
  • Loading branch information
jwflory and Tjzabel committed Feb 27, 2020
1 parent 5e766b2 commit 9ecec70
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
Binary file added docs/_static/about/faq-getidsbot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 27 additions & 12 deletions docs/about/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,30 @@ Please let us know in our developer chat or open a new pull request with a sugge
Telegram
********

**How do I find a chat ID for a Telegram group?**
The chat ID is found when viewing results from the Telegram API from a web browser.
First, add your bot to the group.
Then, open a browser and enter the Telegram API URL with your API token, as explained in `this post <https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id/32572159#32572159>`_.
Next, send a message in the group with the bot username and refresh the browser window.
You will see the chat ID for the Telegram group along with other information.

**I reinstalled TeleIRC after it was inactive for a while. But the bot doesn't work. Why?**
If a Telegram bot is not used for a while, it "goes to sleep".
Even if TeleIRC is configured and installed correctly, you need to "wake up" the bot.
To fix this, *remove the bot from the group and add it again*.
Restart TeleIRC and it should work again.
.. _chat-id:

How do I find a chat ID for a Telegram group?
=============================================

There are two ways we suggest finding the chat ID of a Telegram group.

The easiest way is to add the `@getidsbot <https://t.me/getidsbot>`_ to the group.
As soon as the bot joins the group, it will print a message with the group chat ID.
You can remove the bot once you get the chat ID.

.. image:: /_static/about/faq-getidsbot.png
:alt: Screenshot of sample message when adding @getidsbot to a group

Another way to get the chat ID is from the Telegram API via a web browser.
First, add your bot to the group.
Then, open a browser and enter the Telegram API URL with your API token, as explained in `this post <https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id/32572159#32572159>`_.
Next, send a message in the group that @tags the bot username, and refresh the browser window.
You will see the chat ID for the Telegram group along with other information.

I reinstalled TeleIRC after it was inactive for a while. But the bot doesn't work. Why?
=======================================================================================

If a Telegram bot is not used for a while, it "goes to sleep".
Even if TeleIRC is configured and installed correctly, you need to "wake up" the bot.
To fix this, *remove the bot from the group and add it again*.
Restart TeleIRC and it should work again.
4 changes: 2 additions & 2 deletions docs/config-file-glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ IRC settings

``IRC_SERVER_PASSWORD=""``
IRC server password

``IRC_SERVER_PORT=6697``
IRC server port

Expand Down Expand Up @@ -69,7 +69,7 @@ Telegram settings
*****************

``TELEGRAM_CHAT_ID=-0000000000000``
Telegram chat ID of bridged group (`how do I get this? <http://stackoverflow.com/a/32572159>`_)
Telegram chat ID of bridged group (:ref:`how do I get this? <chat-id>`)

``TELEIRC_TOKEN=000000000:AAAAAAaAAa2AaAAaoAAAA-a_aaAAaAaaaAA``
Private API token for Telegram bot
Expand Down

0 comments on commit 9ecec70

Please sign in to comment.