telegram bot monitor - zenchain telegram bot monitor installation instructions . telegram bot...
Post on 27-Aug-2020
Embed Size (px)
Telegram BOT Monitor Installation Instructions
Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members impersonating group administrators.
Please follow instructions bellow to deploy BOT Monitor to Telegram group.
Creating Group BOT
To create a BOT that will be assigned to group for active monitoring, use Telegram's BotFather as described below:
1. Login to your Telegram account, if you do not have one you can register one for free on https://telegram.me
2. After logging to your Telegram account, call BotFather on following link:
3. Click the button „Open in Web“
4. To get a list of available commands available type command /start in the chat window.
5. To create a new bot type the command /newbot in the chat to create new BOT
6. Once BotFather asks for the bot name, enter the prefered name of your new BOT, e.g. MyGroupBOT. Each bot name must be unique, if you type in a invalid name for your bot you will recieve a warning to change it to a new one.
7. Enter the username for your new BOT (it must end with the word bot), e.g. MyGroupBOTTestbot. The username must be unique for each bot. If the username you enter is invalid you will recieve a warning and you can pick a different username.
8. Once the bot creation is finished sucessfully you will receive a BOT token used
to access the Telegarm HTTP BOT API (Marked in red text in the image). If you misplace this token you can always return to the chat window for BotFather to view it. Once you noted down your token key please click on the link provided by BotFather to continue.
9. Once you click on the provided link you will be taken to a new chat window. To continue the setup click the ''Start'' button located at the bottom of the chat window.
Once the button is clicked the bot will be initialized.
10. To allow the BOT to receive messages from your group, Privacy mode of the
BOT needs to be disabled. To disbale it, return to the BotFather chat window and execute the following commands / actions:
a. type /mybots
b. click on the BOT you want to configure
c. click on BOT Settings
d. click on Group Privacy
e. click Turn off
Note: Privacy mode needs to be disabled before adding BOT the the group.
11. Click on the link of your BOT displayed in the message from the BotFather above (t.me/MyGroupBOTTestbot) and click the button Start
Assign the BOT to Telegram Group
To allow the BOT to monitor group memebers BOT needs to be assigned to your group as administrator. To assign BOT to your group, please follow the instructions below:
1. While in the group, click on the group name in the header
2. Click the button Add member and enter name of your BOT. Select the BOT from the list and click Next.
After the BOT is added as group member, click of group name in header to display group details and double check that BOT has access to messages as on the screen below:
If that is not the case, remove the BOT, disable privacy mode as described in step #10 of Creating Group BOT.
Download and install service
To run the service, you first need to download the source code, install dependencies and configure the service. You need to have node.js, npm and mysql database installed on your computer or server.
1. Download or clone the code available on github link.
2. Run npm install in root folder (or from download location for windows).
3. Create database and import database schema from file bot_db.sql located in folder db.
4. Open configuration file environment.ts located in src/environments folder and set following parameters:
a. Update database connection details by entering database host, port,
name, username and password
b. Enter BOT token obtained in step #8 or Creating Group BOT
c. Enter Chat Id of the group you ant to monitor. To retrieve Chat Id, do the following:
i. send one message to your group as owner of the group
ii. call the url below in the browser:
Note: Replace with your BOT token obtained in step #7 or Creating Group BOT
iii. You will find Chat Id within parameter chat.id as shown on image
iv. Set your Admin's details. You can defined multiple admin entries
5. Start the service by running command in the root folder:
node node_modules\ts-node\dist\bin.js src/bot.ts
6. Now proceed to Telegram and configure as you wish. Type /start to get a list of available commands.
Telegram BOT Monitor Creating Group BOT Assign the BOT to Telegram Group Download and install service