Metadata-Version: 2.4
Name: collaps-bot
Version: 0.1.0
Summary: Library for Collaps Chat bots (Telegram-style), pure stdlib
Author: maksim Churakov
License: MIT
Project-URL: Homepage, https://github.com/USERNAME/collaps-bot
Keywords: collaps,chat,bot,firebase
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# collaps-bot

Библиотека для ботов **Collaps Chat** — в стиле `python-telegram-bot`, без зависимостей (только стандартная библиотека Python 3).

## Установка

```bash
pip install collaps-bot
```

## Быстрый старт

Токен берётся в BotFather (`botfather.html`), формат `<botId>:<secret>`.

```python
from collaps_bot import CollapsBot

bot = CollapsBot("ВСТАВЬ_ТОКЕН")

@bot.command("start")
def start(u):
    u.reply("Привет! Я бот на Python 🐍")

@bot.command("help")
def help_cmd(u):
    u.reply("Команды: /start /help /echo")

@bot.command("echo")
def echo_cmd(u):
    u.reply(" ".join(u.args) or "Напишите текст после /echo")

@bot.message
def fallback(u):
    u.reply("Вы написали: " + u.text)

bot.run()
```

## API

- `CollapsBot(token, db_url=..., poll_interval=2.0)`
- `@bot.command("name")` — обработчик команды `/name`
- `@bot.message` — обработчик остальных сообщений
- `bot.send_message(chat_id, text)`
- `bot.run()` — запуск polling-цикла
- в обработчике доступны: `u.text`, `u.args`, `u.command`, `u.sender_id`, `u.sender_name`, `u.chat_id`, `u.reply(...)`

## Лицензия

MIT
