Skip to main content

A zero-boilerplate simple telegram bots

Project description

PyPI PyPI - Python Version GitHub

TgBotZero

Телеграм-боты в пару строчек кода. Простые телеграм-боты должно быть очень просто делать!

Примеры

Бот, показывающий твоё сообщение:

import tgbotzero

TOKEN = '123123123:tokenFromBotFatherInTelegram'

def on_message(msg: str):
    return "Твоё сообщение: " + msg
echobot

Бот с кнопками:

from tgbotzero import *

TOKEN = '123:tokenHereFromBotFatherInTelegram'

def on_message(msg: str):
    return [
        "Твоё сообщение: " + msg,
        Button('Кнопка', 'btn'),
    ]

def on_button_btn(data):
    return 'Нажата кнопка. Отправьте любое сообщение для продолжения'

run_bot()
echobot

Установка

Введите в терминале:

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)

Uploaded Source

Built Distribution

tgbotzero-0.0.2-py3-none-any.whl (11.9 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