Metadata-Version: 2.4
Name: pyyapper
Version: 1.0.0
Summary: An intuitive, async Python library for the Yapper bot API.
Author: PyYapper contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/pyyapper/pyyapper
Project-URL: Documentation, https://www.yapper.website/developers/
Project-URL: Repository, https://github.com/pyyapper/pyyapper
Project-URL: Issues, https://github.com/pyyapper/pyyapper/issues
Keywords: yapper,bot,api,chat,discord-like
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Dynamic: license-file

# PyYapper

An intuitive, async Python library for the [Yapper](https://www.yapper.website) bot API.
Designed to feel familiar to `discord.py` users while staying small and dependency-light.

## Install

```bash
pip install pyyapper
```

Requires Python 3.9+ and `aiohttp`.

## Quick start

```python
from pyyapper import Bot

bot = Bot("yb_...")  # your token from Settings -> Developer


@bot.command("ping", description="Is the bot alive?")
async def ping(ctx):
    await ctx.reply("pong")


@bot.event
async def on_ready(me):
    print("online as", me.username)


bot.run()
```

## Features

- Async-first, with a synchronous `bot.run()` entry point.
- Decorator-based commands and events (`@bot.command`, `@bot.event`, `@bot.button`).
- Rich message context: `ctx.reply`, `ctx.say`, `ctx.author_mention`, `ctx.argv`.
- Button/interaction helpers: `i.reply`, `i.ephemeral`, `i.update`, `i.ack`.
- `Embed`, `Button`, `Row` builders with chaining.
- Typed data models (`User`, `Message`, `Channel`, ...) and a full exception hierarchy.
- Automatic retry on `429` with `Retry-After`, exponential backoff, timeouts.
- Long-polling event loop with cursor tracking (nothing lost on reconnect).

## Error handling

```python
from pyyapper import Bot, NotFound, Forbidden, RateLimited

bot = Bot("yb_...")

async def main():
    try:
        await bot.delete("some-channel", "some-message")
    except NotFound:
        print("message already gone")
    except Forbidden:
        print("missing Manage messages permission")
    except RateLimited as e:
        print("slow down, retry after", e.retry_after)

import asyncio
asyncio.run(main())
```

## Documentation

See the Yapper developer docs: https://www.yapper.website/developers

## License

MIT
