Metadata-Version: 2.4
Name: fastapi-interactions
Version: 0.0.1
Summary: A lightweight framework for discord interactions over http built on FastAPI
Author-email: Haider Ali <haideralidevnull@gmail.com>
Requires-Python: >=3.13
Description-Content-Type: text/markdown
Requires-Dist: fastapi[standard]>=0.138.0
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pynacl>=1.6.2
Requires-Dist: httpx>=0.28.1
Requires-Dist: loguru>=0.7.3
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"

<a href='https://fastapi-interactions.readthedocs.io/en/latest/' target='_blank'>Read the docs here</a>

# Install fastapi-interactions

```
pip install fastapi-interactions
```

# Quick example

```python
from fastapi_interactions import Bot
from fastapi_interactions.commands import (
    CommandRouter, option,
)

bot = Bot(app_id='DISCORD_APP_ID',
          public_key='DISCORD_PUBLIC_KEY',
          bot_token='DISCORD_BOT_TOKEN')

router = CommandRouter()


@router.command('helloworld', 'say hello')
async def hello(ctx):
    return 'hello'


@router.command('echo', 'echo a phrase back')
@option('text', 'the text to repeat')
async def echo(ctx, text: str):
    return text

bot.attach_router(router)

bot.sync_commands()  # Use only on build time if running on vercel
app = bot.app

```
---

> [!WARNING]
> ### SYNCING COMMANDS
> If you are on a serverless architecture like Vercel, make sure you only call `bot.sync_commands` during build time. You do not want this being executed every time you receive an interaction in production.

---
