Metadata-Version: 2.4
Name: pigeon-bot
Version: 0.1.1
Summary: A Python library for interacting with Pigeon Messenger
Home-page: https://github.com/PigeonMessage/pigeon-bot-python
Author: BenimFurka
Keywords: pigeon,chat,websocket,bot
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websockets>=12.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: typing-extensions>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Pigeon Bot Python

[![Python](https://img.shields.io/badge/python-%3E%3D3.8-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

A Python library for building chat bots on the Pigeon Messenger.

## Installation

```bash
pip install pigeon-bot
```

## Quick Start

```python

import asyncio
import os
from pigeon_bot import Client, ClientConfig

async def main():
    token = os.getenv("BOT_TOKEN")
    if not token:
        print("Please set your bot token in the BOT_TOKEN environment variable")
        return

    config = ClientConfig(
        token=token,
        base_url="http://localhost",
        ws_url="ws://localhost/api/v1/ws"
    )
    client = Client(config)

    @client.on_event("ready")
    async def on_ready():
        print("bot is ready!")

    @client.on_event("new_message")
    async def on_new_message(message):
        if "hello" in message.content.lower():
            await message.reply("hi")

    await client.connect()

if __name__ == "__main__":
    asyncio.run(main())
```

## Configuration

```python
class ClientConfig:
    token: str
    base_url: Optional[str] = "http://localhost:8000"
    ws_url: Optional[str] = None
    auto_reconnect: bool = True
    reconnect_interval_ms: int = 5000
```

## Base Events

- `ready`: Fires when the bot connects successfully
- `authenticated`: Fires after successful authentication
- `new_message`: Triggered on new messages
- `error`: Emitted on connection/authentication errors

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
