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 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
Built Distribution
File details
Details for the file asyncgram-0.0.4.tar.gz
.
File metadata
- Download URL: asyncgram-0.0.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.7.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b785db4610ac0940aae7dbe72a3cd43526d338cc34cec3d004a3c043bcc354c |
|
MD5 | 3655679d91b469926e698eba68ba6e6f |
|
BLAKE2b-256 | 190365c340abf430fa56cefbf5d1b76e17a8fea6c0d12cc1412166b1426c822b |
File details
Details for the file asyncgram-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: asyncgram-0.0.4-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.7.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e638ffaae94bb3c44e8ae45f46b8a320343430a09294ca99d41685891995a075 |
|
MD5 | 5af89c36456309f417c21d02e092fde9 |
|
BLAKE2b-256 | 2ed1423d802a5c0b36989d34aaf2ea4339019ebdc657c8ad2596f80b4aabf7d9 |