telegramtk
Telegram toolkit
This package provides easy (and sync) access for the Telegram Bot API.
Installation
pip install telegramtk
Setup
First of all you must create a Telegram bot and grab the bot token.
import telegramtk
telegramtk.init('<your-telegram-bot-token-here>')
Send message
import telegramtk
telegramtk.send_message(to, msg)
Notes:
tois the recipient and must be a chat id (integer value) or a known name (string value).msgis the message (string value) and can be "Markdown" formatted.
Error handling
If an error ocurred during the request to the Telegram API, an exception is raised. You can find this exception at:
import telegramtk
from telegramtk.exceptions import TelegramError
try:
telegramtk.send_message(to, msg)
except TelegramError as err:
handle_error(err)
Escape markdown
It's common to send Markdown content through Telegram, but sometimes we want to escape Markdown symbols in order to avoid syntax errors when parsing.
For that end, you might use the following function:
from telegramtk.utils import escape_markdown
>>> escape_markdown('Just some *Markdown* _stuff_ [here](https://example.com/)')
'Just some \\*Markdown\\* \\_stuff\\_ \\[here\\]\\(https://example\\.com/\\)'
💡 Source: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/helpers.py#L45
Metadata
Release files for telegramtk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| telegramtk-0.1.0.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telegramtk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / telegramtk-0.1.0.tar.gz
| Download URL | telegramtk-0.1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae2d3ef00b2f316f15f1283d4f79f7885d0f713cfea6433416d129f6a93bda3c
|
|
BLAKE2b-256 checksum How to use checksums |
7bc8e621bd4668e790bb32b519016076e8ee7089b5a87be1d224ac489aa023a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / telegramtk-0.1.0-py3-none-any.whl
| Download URL | telegramtk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b9e45c806427724aafbe614a44b112cd0275e6e080795e8b90461057558d830
|
|
BLAKE2b-256 checksum How to use checksums |
095a3f3d775b86587af5346d59b4397055e9940932395357d85f36f4f7078800
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for telegramtk 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.