Metadata-Version: 2.4
Name: discord-self-quest
Version: 2.0.0
Summary: Lightweight Python library and CLI to auto-complete Discord Quests.
Author: discord-self-quest contributors
License-Expression: MIT
Keywords: discord,quest,discord-quest,automation,discord-self-quest
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
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
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0

# discord-self-quest

A lightweight, developer-friendly Python library and CLI tool to inspect, enroll in, and automate Discord quests.

---

## Features

- **Python API (Library Mode)**: Simple and clean client interface (`QuestClient`) with custom progress callbacks.
- **Interactive CLI**: Fast terminal user interface for managing quests and HypeSquad badges.
- **Headless CLI**: Run one-liner commands in scripts or cron jobs using `--all`.
- **Automatic Task Handling**: Supports video playback quests and heartbeat desktop / stream quests.
- **Rate Limit & Retry Protection**: Built-in exponential backoff and rate-limit queue management.

---

## Installation

### From local directory / repository:

```bash
pip install .
```

Or install in editable mode for development:

```bash
pip install -e .
```

### Install with pip (from wheel or git):

```bash
pip install git+https://github.com/your-username/discord-self-quest.git
```

---

## Quickstart (Python Module Usage)

### 1. One-Liner to Complete All Quests

```python
import discord_self_quest

# Complete all active quests
completed = discord_self_quest.complete_all(token="YOUR_DISCORD_TOKEN")
print(f"Completed {len(completed)} quests!")
```

### 2. Using `QuestClient`

```python
from discord_self_quest import QuestClient

with QuestClient(token="YOUR_DISCORD_TOKEN") as client:
    # 1. Fetch user profile
    user = client.login()
    print(f"Logged in as: {user.tag} ({user.id})")

    # 2. List active quests
    quests = client.get_active_quests()
    for q in quests:
        print(f"- {q.name} [{q.task_label}] Progress: {q.percentage}%")

    # 3. Complete all quests
    client.complete_all()
```

### 3. Custom Progress Callback

Track quest progress in your own application, webhook, or GUI:

```python
from discord_self_quest import QuestClient

def on_progress(quest, current, target, percent):
    print(f"[{quest.name}] {current:.0f}/{target:.0f}s ({percent}%)")

with QuestClient(token="YOUR_DISCORD_TOKEN") as client:
    client.complete_all(on_progress=on_progress, verbose=False)
```

### 4. Set HypeSquad House

```python
from discord_self_quest import QuestClient, HypeSquadHouse

with QuestClient(token="YOUR_DISCORD_TOKEN") as client:
    # Set to Bravery (1), Brilliance (2), or Balance (3)
    ok, message = client.set_hypesquad(HypeSquadHouse.BRAVERY)
    print(message)
```

---

## CLI Usage

### Interactive Menu

Run the CLI command:

```bash
discord-self-quest
```

Or run via python module:

```bash
python3 -m discord_self_quest
```

### Direct Non-Interactive Execution

Provide your token directly or via environment variable:

```bash
export DISCORD_TOKEN="YOUR_DISCORD_TOKEN"
discord-self-quest --all
```

Or with the `-t` argument:

```bash
discord-self-quest -t "YOUR_DISCORD_TOKEN" --all
```

---

## License

MIT License.
