A zero-boilerplate simple telegram bots
Project description
TgBotZero
Телеграм-боты в пару строчек кода. Простые телеграм-боты должно быть очень просто делать!
Примеры
Бот, показывающий твоё сообщение:
import tgbotzero
TOKEN = '123123123:tokenFromBotFatherInTelegram'
def on_message(msg: str):
return "Твоё сообщение: " + msg
Бот с кнопками:
from tgbotzero import *
TOKEN = '123:tokenHereFromBotFatherInTelegram'
def on_message(msg: str):
return [
"Твоё сообщение: " + msg,
Button('Кнопка', 'btn'),
]
def on_button_btn(data):
return 'Нажата кнопка. Отправьте любое сообщение для продолжения'
run_bot()
Установка
Введите в терминале:
pip install tgbotzero --upgrade --user
Или запустите эту программу:
import os, sys
python = sys.executable
user = '--user' if 'venv' not in python and 'envs' not in python else ''
cmd = f'"{python}" -m pip install tgbotzero --upgrade {user}'
os.system(cmd)
Contributing
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
tgbotzero-0.0.2.tar.gz
(153.3 kB
view hashes)
Built Distribution
tgbotzero-0.0.2-py3-none-any.whl
(11.9 kB
view hashes)
Close
Hashes for tgbotzero-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8a0985ceeaf9e8370e2155c3506de293c4febf6a8073b260d8ddaadd953314 |
|
MD5 | 75537920116dfc14994698100e24f496 |
|
BLAKE2b-256 | ece672d6aea3c47ce3f20fe1660757c2c20f85cc55e6bbfe43a3b642e6b61ec4 |