Metadata-Version: 2.4
Name: cascade-discord
Version: 0.4.2
Summary: High-performance Discord selfbot library for Python
Author: Cascade Contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/4f2b/cascade
Project-URL: Documentation, https://cascade-discord.readthedocs.io
Project-URL: Repository, https://github.com/4f2b/cascade
Project-URL: Issues, https://github.com/4f2b/cascade/issues
Project-URL: Changelog, https://github.com/4f2b/cascade/blob/main/CHANGELOG.md
Keywords: discord,api,selfbot,async,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: AsyncIO
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: websockets>=12.0
Provides-Extra: voice
Requires-Dist: PyNaCl>=1.5.0; extra == "voice"
Requires-Dist: opuslib>=3.0.1; extra == "voice"
Provides-Extra: security
Requires-Dist: cryptography>=42.0.0; extra == "security"
Dynamic: license-file

# cascade

High-performance Discord user API wrapper for Python.

## Install

```bash
pip install cascade-discord
```

Voice support:
```bash
pip install cascade-discord[voice]
```

## Quick Start

```python
from cascade import Session

session = Session('your_token')

@session.event
async def on_ready():
    print(f'{session.user.name} ready')

@session.event
async def on_message(message):
    if message.content == '!ping':
        await message.reply('pong')

session.run()
```

## Features

- Full Gateway v10 with reconnect and resume
- 120+ REST endpoints
- Rate limit handling with per-bucket tracking
- Platform spoofing (desktop, mobile, web, console, VR)
- Rich presence builder
- Voice support (FFmpeg + Opus)
- Interactions (buttons, select menus, modals)
- AutoMod rules
- Layered caching (LRU/LFU/FIFO/TTL)
- Token protection and fingerprint randomization
- Commands framework
- Quest system with safe heartbeat loops
- Thread and webhook management
- Bulk operations

## Examples

### Send Messages

```python
channel = session.get_channel(channel_id)
await channel.send('hello')

user = session.get_user(user_id)
await user.send('dm')
```

### Friend Requests

```python
await session.send_friend_request('username')

friends = await session.fetch_friends()
for friend in friends:
    print(friend.display_name)
```

### Join Servers

```python
await session.accept_invite('discord-api')
```

**Note**: Some servers require captcha verification. You'll get a 400 error with captcha details — handle this in your application.

### Quests

```python
quests = await session.quests.get_quests()
active = await session.quests.get_active_quests()

for quest in active:
    await session.quests.run_heartbeat_loop(quest.id)
```

### Rich Presence

```python
from cascade import Activity

activity = Activity.playing('My Game')
await session.change_presence(status='online', activity=activity)
```

### Threads

```python
thread = await channel.create_thread('Thread Name')
await thread.join()
await thread.send('first message')
```

### Webhooks

```python
webhook = await session.rest.get_webhook(webhook_id)
await webhook.send('webhook message')
```

### Bulk Operations

```python
messages = await channel.fetch_messages(limit=100)
message_ids = [m.id for m in messages]
await channel.bulk_delete(message_ids)
```

## Documentation

[https://cascade-discord.readthedocs.io](https://cascade-discord.readthedocs.io)

## Links

- **GitHub**: [https://github.com/4f2b/cascade](https://github.com/4f2b/cascade)
- **PyPI**: [https://pypi.org/project/cascade-discord](https://pypi.org/project/cascade-discord)
- **Docs**: [https://cascade-discord.readthedocs.io](https://cascade-discord.readthedocs.io)

## License

MIT
