Telegram bot for controlling spam, logging, and more
Go to file
2018-01-28 22:29:50 -07:00
.gitignore Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00
bot.py Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00
config.cnf.sample Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00
LICENSE Initial commit 2018-01-25 19:51:46 -07:00
model.py Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00
README.md Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00
requirements.txt Cleaned up README and moved config info out of version control 2018-01-28 22:29:50 -07:00

Telegram Group Chat Logger

This is a bot that logs public Group Chats to a Postgres Database.

Installation

  • Required: Python 3.x, pip, PostgreSQL
  • Clone this repo
  • pip install --upgrade -r requirements.txt

Telegram Bot Setup

export TELEGRAM_BOT_TOKEN="4813829027:ADJFKAf0plousH2EZ2jBfxxRWFld3oK34ya"

Running the bot

  • Create a Postgres database.
$psql
CREATE DATABASE telegram_bot_db;
  • Copy config.cnf.sample to config.cnf and edit the databse connection URL. File should look like this:
[postgres]
postgres_url = postgresql://<user>:<password>@localhost:5432/<databasename>
  • Run: python model.py to setup the DB tables.
  • Run: python bot.py to start logger
  • When a messages is successfully logged, message logged will be displayed.