GithubHelp home page GithubHelp logo

g0053 / telegram-bot-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zenchainsoftware/telegram-bot-monitor

0.0 0.0 0.0 2.17 MB

Telegram BOT Monitor allows automatic monitoring of Telegram group members and banning members impersonating group administrators.

License: Other

TypeScript 100.00%

telegram-bot-monitor's Introduction

Zenchain Telegram Anti-Phishing Admin Bot

Zenchain Telegram Anti-Phishing Admin Bot allows automatic monitoring of Telegram group members and banning members impersonating group administrators. Telegram Bot Monitor retrieves a list of group administrators automatically from the group and checks against a list of group members. If the Bot identifies a member as the one impersonating administrator, it will automatically ban the member. In addition, the Bot also has features which can be toggled to remove, warn and ban usage of images, links, crypto wallet addresses/keys, and inappropriate language. Follow instructions below to deploy the 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. After logging to your Telegram account, call BotFather on the following link:

    https://telegram.me/botfather

  2. Click the button „Open in Web“

  3. Type command /start

  4. Type command /newbot to create new Bot

  5. Enter the name of your new Bot, e.g. MyGroupBot

  6. Enter the username for your new Bot (it must end with the word bot), e.g. MyGroupBotTestbot

  7. You will receive a Bot token used to access the Telegram Bot API

  8. To allow the Bot to receive messages from your group, Privacy mode of the Bot needs to be disabled. To disable it, execute following commands/actions:

    a. type /mybots

    b. click on the Bot MyGroupBotTestbot

    c. click on Bot Settings

    d. click on Group Privacy

    e. click Turn off

    Note: Privacy mode needs to be disabled before adding Bot to the group.

  9. 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 members 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 the name of your Bot. Select the Bot from the list and click Next.

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 and npm installed on your computer or server.

  1. Download or clone the code

  2. Run in root folder

    npm install
    

Service can work with SQLite and MySQL databases. SQLite database file is provided and enabled by default. No additional software is required to use SQLite database. Should you like to use mysql database instead, you need to install MySQL server and proceed with step 3. Otherwise, proceed with step 4.

  1. Create database user, database and import database schema from file bot_db_mysql.sql located in folder db. Grant all permissions on created database to created database user.

  2. Copy configuration file environment.ts.dist as environment.ts located in src/environments folder and set following parameters:

    a. If selected database is SQLite, skip this step. If it is MySQL,uUpdate database connection details by entering database host, port, name, username and password and set useDatabase to mysql

    b. Enter Bot token obtained in step #7 or Creating Group Bot

    c. Enter Chat Id of the group you want to monitor. To retrieve Chat Id, do the following:

    i.	send one message to your group as the 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
    
  3. Start the service by running the command in the root folder:

    node node_modules/ts-node/dist/bin.js src/bot.ts
    

telegram-bot-monitor's People

Contributors

zenchaingroup avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.