telegram bot monitor - zenchain · telegram bot monitor installation instructions . telegram bot...

20
www.zenchain.com 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.

Upload: others

Post on 27-Aug-2020

85 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 2: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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:

https://telegram.me/botfather

3. Click the button „Open in Web“

Page 3: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

4. To get a list of available commands available type command /start in the chat window.

Page 4: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

5. To create a new bot type the command /newbot in the chat to create new BOT

Page 5: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 6: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 7: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 8: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 9: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

Once the button is clicked the bot will be initialized.

Page 10: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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

Page 11: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

b. click on the BOT you want to configure

Page 12: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

c. click on BOT Settings

Page 13: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

d. click on Group Privacy

Page 14: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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

Page 15: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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

Page 16: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

2. Click the button Add member and enter name of your BOT. Select the BOT from the list and click Next.

Page 17: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 18: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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.

Page 19: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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

Page 20: Telegram BOT Monitor - Zenchain · Telegram BOT Monitor Installation Instructions . Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members

www.zenchain.com

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:

https://api.telegram.org/bot<botToken>/getUpdates

Note: Replace <botToken> 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

below:

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.