Skip to content

Commit

Permalink
add handler and appendix page
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <jkandasa@gmail.com>
  • Loading branch information
jkandasa committed May 12, 2021
1 parent 5117036 commit fa816d3
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 5 deletions.
52 changes: 49 additions & 3 deletions content/en/docs/appendix/telegram.md
@@ -1,6 +1,52 @@
---
title: "Telegram Helper"
linkTitle: "Telegram Helper"
title: "Setup Telegram Bot"
linkTitle: "Setup Telegram Bot"
weight: 1
---
TBD
This document helps to setup your telegram to receive messages from MyController.<br>
MyController needs a telegram `token` and a `chat id` and/or `group id` to send a messages.<br>
* [Create a bot and generate a token](#create-a-telegram-bot)
* [Get user `chat id`](#get-user-chat-id)
* [Get `group id`](#get-group-chat-id)

## Create a telegram bot
Open [Telegram messenger](https://telegram.org/apps), sign in to your account or create a new one.
1. Enter `@Botfather` in the search tab and choose this bot.<br>
**Note:** official Telegram bots have a <span style="color:blue">blue checkmark</span> beside their name
2. Click `START` to activate BotFather bot. In response, you receive a list of commands to manage bots.
3. Choose or type the `/newbot` command and send it.
4. Choose a name for your bot. And choose a username for your bot, the bot can be found by its username in searches.
The username must be unique and end with the word `bot`
5. After you choose a suitable name for your bot, the bot is created. You will receive a message with a link to your bot `t.me/<bot_username>`, recommendations to set up a profile picture, description, and a list of commands to manage your new bot.
6. To connect a bot to MyController you need a token. Copy your token value and add it in to [Telegram handler](/docs/user-interface/operations/handlers/#telegram-handler).

## Get user chat id
User chat id can be extracted via API or with a supported bot.<br>
Here the details are given to get `chat id` via `MyController.org bot`<br>

* On your telegram application on the search input enter `mycontroller_org_bot`.<br>
You can see `MyController.org bot` bot as shown blow.<br>
![telegram search mycontroller bot](/doc-images/telegram_chat_01_bot_search.png)<br>

* Click on the `START` to get connect with `MyController.org bot`<br>
![telegram start mc bot](/doc-images/telegram_chat_02_mc_bot_start.png)<br>

* `MyController.org bot` info will be as below,<br>
![telegram mc bot info](/doc-images/telegram_chat_03_mc_bot_info.png)<br>

* Send a text `chat id`, you will get a response with your `chat_id`<br>
![telegram get chat id](/doc-images/telegram_chat_04_chat_id.png)<br>


## Get group chat id
Group id can be extracted via API or with a known bot.<br>
Here the details are given to get group id via `MyController.org bot`<br>

* Open your group and click on `Add members`<br>
![telegram add member](/doc-images/telegram_group_01_add_member.png)<br>

* on the search input type `mycontroller_org` then select `MyController.org bot` and click on `ADD`<br>
![telegram add to group](/doc-images/telegram_group_02_add_mc_bot.png)<br>

* Send a text `chat id`, you will get a response with your `group_id` and `chat_id`<br>
![telegram group id](/doc-images/telegram_group_03_group_id.png)<br>
4 changes: 2 additions & 2 deletions content/en/docs/user-interface/operations/handlers.md
Expand Up @@ -53,7 +53,7 @@ spec:

### Telegram Handler
Sends telegram message to persons and/or groups.<br>
[Follow this guide to get the telegram token and chatId](/docs/appendix/telegram/)<br>
[Follow this guide to get the telegram token, chat_id and group_id](/docs/appendix/telegram/)<br>

![telegram handler](/doc-images/mc_telegram_handler.png)

Expand All @@ -67,7 +67,7 @@ spec:
```
1. `type` should be selected as `telegram`
2. `token` of the telegram account
3. `chatIds` - list of person or group ids
3. `chatIds` - list of chat ids or group ids

### Backup Handler
Backup handler performs backup operation and keeps the backup archives at the specified target location<br>
Expand Down
Binary file added static/doc-images/telegram_chat_01_bot_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_chat_04_chat_id.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc-images/telegram_group_03_group_id.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fa816d3

Please sign in to comment.