Skip to main content

Logs Telegram events to your console, file(s) or both simultanously.

Project description

telegram-logger

A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram.

Requirements

  • Python 3.6 or newer
  • Python package dependencies: poetry install or pip install -r requirements.txt
  • A Telegram user or bot account

Usage

Set your api_id and api_hash in config.toml. You can get this from "API development tools" on https://my.telegram.org/. Note that this authenticates an app, not a user.

When you start the script for the first time, you will be prompted for credentials. Upon successful authentication, it will start logging all messages it can see to stdout.

You can set enabled_chats and disabled_chats in the config to a list of chat IDs to control which chats should be logged (the default is all).

You can set log_seperate_files to false if you want the all logging to be saved to one file, the default is one file per chatId.

When logging to files, you may want to turn logging to stdout off, by setting log_stdout to false.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram-logger-x-0.12a0.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

telegram_logger_x-0.12a0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page