Skip to main content

A lightweight, asynchronous telegram logging client

Project description

Telegram requirements

To be able to use this tool, you will require a Telegram bot token and a group chat ID.

Telegram bot token reference

Telegram group chat ID reference

Installation

pip install asyncgram

Usage

Once you have your telegram bot token and group chat ID, and you've install asyncgram, you are ready to get started.

Creating a client

from asyncgram import Asyncgram

# replace XXX with your keys
TG_BOT_TOKEN = "XXX"
TG_GROUP_ID = "XXX"

client = Asyncgram(
    tg_token = TG_BOT_TOKEN, 
    tg_group = TG_GROUP_ID
)

Logging messages

client.start()

messages = [
    'Hello world',
    'My name is codeman',
    'My birthday was yesterday.'
]

for msg in messages: client.put(msg)

client.stop()

This is a toy example to get you started. Recommended usage would be to put relevant messages from some form of a websocket connection such that it's logged in an asynchronous way.

Donations

If you liked this tool and would like to support me, kindly send your donations in ETH to 0xB08f9B316ddBCA4Dc5736153Cd63B8d9Bec46Bab

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

asyncgram-0.0.3.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

asyncgram-0.0.3-py3-none-any.whl (2.6 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