Telegram toolkit
Project description
telegramtk
Telegram toolkit
This package provides easy (and sync) access for the Telegram Bot API.
Installation
pip install telegramtk
Setup
import telegramtk
telegramtk.init('<your-telegram-bot-token-here>')
Send message
import telegramtk
telegramtk.send_message(to, msg)
→ msg
can be "Markdown" formatted.
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
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
telegramtk-0.0.6.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for telegramtk-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea2518ca1a5181d08e5fe2e4b26187f9268775cc0061ce178c17bb9fcccd727 |
|
MD5 | b36230260fff95822487fad57fb93247 |
|
BLAKE2b-256 | e0428a7b7b9bd4dcb03437384cfc762af9ab5719bb7b5e1fb9b999e60b571741 |