Metadata-Version: 2.4
Name: realchat-sdk
Version: 0.1.0
Summary: Python SDK for building bots on the RealChat platform
Project-URL: Homepage, https://github.com/838288383838383/realchat-sdk
Project-URL: Documentation, https://github.com/838288383838383/realchat-sdk#readme
Project-URL: Repository, https://github.com/838288383838383/realchat-sdk
Project-URL: Issues, https://github.com/838288383838383/realchat-sdk/issues
Author-email: Real Inc <real@realinc.dev>
License-Expression: MIT
Keywords: bot,chat,realchat,sdk,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.14.1
Requires-Dist: websockets>=16.0
Description-Content-Type: text/markdown

# realchat-sdk

Python SDK for building bots on the [RealChat](https://realchat.vercel.app) platform.

## Installation

```bash
pip install realchat-sdk
```

## Quick Start

```python
import asyncio
from realchat import Client

client = Client(token="RC.your_bot_token_here")

@client.event("on_ready")
async def on_ready():
    print(f"Logged in as {client.user.username}")

@client.event("on_message")
async def on_message(message):
    if message.content == "!ping":
        await message.channel.send("Pong!")

    if message.content == "!hello":
        await message.channel.send(f"Hello {message.author.username}!")

asyncio.run(client.start())
```

## Events

| Event | Description |
|-------|-------------|
| `on_ready` | Bot connected and authenticated |
| `on_message` | Message received in any channel |
| `on_typing` | User started typing |
| `on_presence` | User status changed |
| `on_disconnect` | WebSocket disconnected |

## REST API

```python
from realchat import Client

client = Client(token="RC.your_bot_token_here")

async def main():
    # Get bot's user info
    user = await client.http.get_me()
    print(f"I am {user.username}")

    # List servers the bot is in
    servers = await client.http.get_servers()
    for server in servers:
        print(f"  - {server.name} ({server.id})")

    # Get channels in a server
    channels = await client.http.get_channels(servers[0].id)
    for channel in channels:
        print(f"  # {channel.name}")

    # Send a message
    await client.http.send_message(channel.id, "Hello from my bot!")

    # Read messages
    messages = await client.http.get_messages(channel.id, limit=10)
    for msg in messages:
        print(f"  {msg.author.username}: {msg.content}")

    await client.close()

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

## Getting a Bot Token

1. Go to the [Developer Portal](https://realchat.vercel.app/developer)
2. Create a new bot
3. Copy the bot token (starts with `RC.`)
4. Use it in your code

## License

MIT
