Metadata-Version: 2.4
Name: netcherTG
Version: 0.1.0
Summary: A simple, dependency-light library for building Telegram bots
Author: Necher
License: MIT
Project-URL: Homepage, https://pypi.org/project/netcherTG/
Keywords: telegram,bot,telegram-bot,api
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25

# netcherTG

A simple, dependency-light Python library for building Telegram bots on top
of the official Telegram Bot HTTP API.

## Install

```bash
pip install netcherTG
```

## Getting a bot token

Message [@BotFather](https://t.me/BotFather) on Telegram, run `/newbot`,
and follow the prompts to get an API token.

## Quick start

```python
from netcherTG import Bot

bot = Bot("123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")

@bot.command("start")
def start(bot, message):
    bot.send_message(message.chat_id, f"Hello, {message.username}!")

@bot.command("echo")
def echo(bot, message):
    text = " ".join(message.args()) or "(nothing to echo)"
    bot.send_message(message.chat_id, text)

@bot.message_handler()
def fallback(bot, message):
    bot.send_message(message.chat_id, "I didn't understand that.")

bot.run()
```

## Inline keyboards

```python
from netcherTG import Bot, keyboards

bot = Bot("YOUR_TOKEN")

@bot.command("menu")
def menu(bot, message):
    kb = keyboards.inline_keyboard([
        [("Yes", "yes"), ("No", "no")],
    ])
    bot.send_message(message.chat_id, "Choose one:", reply_markup=kb)

@bot.callback_query_handler()
def on_click(bot, query):
    bot.answer_callback_query(query.id, text="Got it!")
    bot.send_message(query.message.chat_id, f"You picked: {query.data}")

bot.run()
```

## Reply keyboards

```python
from netcherTG import keyboards

kb = keyboards.reply_keyboard([["Option A", "Option B"], ["Cancel"]])
bot.send_message(chat_id, "Pick one:", reply_markup=kb)
```

## API overview

| Method | Description |
|---|---|
| `Bot(token)` | Create a bot instance |
| `bot.send_message(chat_id, text, ...)` | Send a text message |
| `bot.send_photo(chat_id, photo_url, caption=None)` | Send a photo |
| `bot.edit_message_text(chat_id, message_id, text)` | Edit an existing message |
| `bot.delete_message(chat_id, message_id)` | Delete a message |
| `bot.answer_callback_query(id, text=None)` | Acknowledge a button press |
| `bot.get_me()` | Get info about the bot |
| `@bot.command(name)` | Register a `/command` handler |
| `@bot.message_handler()` | Register a handler for plain text messages |
| `@bot.callback_query_handler()` | Register a handler for inline button presses |
| `bot.run(poll_interval=1.0)` | Start long-polling |

## License

MIT
