Metadata-Version: 2.4
Name: dihook
Version: 1.0.1b1
Summary: A lightweight Python library for sending Discord webhook messages and embeds.
Author-email: DJ KAIF <djkaifdev@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/dj-kaif/dihook
Project-URL: Repository, https://github.com/dj-kaif/dihook
Project-URL: Bug Tracker, https://github.com/dj-kaif/dihook/issues
Project-URL: Changelog, https://github.com/dj-kaif/dihook/blob/main/CHANGELOG.md
Project-URL: PyPI, https://pypi.org/project/dihook
Keywords: discord,webhook,bot,notification,embed,discord-webhook
Classifier: Development Status :: 4 - Beta
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: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Internet
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Dynamic: license-file

# dihook

> A lightweight Python library for sending Discord webhook messages and embeds.

[![Version](https://img.shields.io/badge/version-v1.0.0--beta-blue)](https://github.com/dj-kaif/dihook/releases)
[![PyPI](https://img.shields.io/pypi/v/dihook)](https://pypi.org/project/dihook)
[![Python](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Stars](https://img.shields.io/github/stars/dj-kaif/dihook?style=social)](https://github.com/dj-kaif/dihook)

**dihook** makes it effortless to send Discord notifications from any Python script — plain messages, rich embeds, or both. No boilerplate, no hassle.

> ⚠️ **v1.0.0-beta** — This is a pre-release. APIs are stable but may have minor changes before `v1.0.0`. [Report issues here.](https://github.com/dj-kaif/dihook/issues)

---

## Installation

**From PyPI (recommended):**
```bash
pip install dihook
```

**From GitHub (latest beta):**
```bash
pip install git+https://github.com/dj-kaif/dihook.git@main
```

---

## Quick Start

**Send a plain message:**
```python
import webhook

webhook.send_message("YOUR_WEBHOOK_URL", "Hello from webhook.py! 🚀")
```

**Send an embed:**
```python
import webhook
from webhook import Embed, Color

embed = Embed(title="Hello!", description="This is an embed.", color=Color.BLURPLE)
webhook.send_embed("YOUR_WEBHOOK_URL", embed)
```

---

## Examples

### Server / uptime monitor

```python
import webhook
from webhook import Embed, Color

embed = (
    Embed(title="🚨 Alert", description="CPU usage exceeded 90%!", color=Color.RED)
    .add_field("Host",   "prod-server-1", inline=True)
    .add_field("Usage",  "94.3%",         inline=True)
    .set_footer("Monitor Bot")
    .set_timestamp()
)

webhook.send_embed("YOUR_WEBHOOK_URL", embed)
```

### Bot notification

```python
import webhook
from webhook import Embed, Color

embed = (
    Embed(title="✅ Task Complete", color=Color.GREEN)
    .add_field("Task",   "Nightly backup", inline=True)
    .add_field("Status", "Success",        inline=True)
    .set_timestamp()
)

webhook.send_embed("YOUR_WEBHOOK_URL", embed, username="Task Bot")
```

### Website / form notification

```python
import webhook

webhook.send_message(
    webhook_url="YOUR_WEBHOOK_URL",
    text="📬 New contact form submission from **John Doe** — john@example.com",
    username="My Website",
)
```

For more complete, copy-paste ready scripts see the [`examples/`](examples/) folder:

- [`examples/basic_msg/`](examples/basic_msg/) — plain text messages (positional args, keyword args, return value)
- [`examples/basic_embed/`](examples/basic_embed/) — embeds (minimal, fully featured, multiple embeds)

---

## Project Structure

```text
dihook-package/
├── webhook/
│   ├── __init__.py
│   ├── notifier.py
│   └── embed.py
│
├── examples/
│   ├── basic_msg/
│   │   ├── basic_msg.py
│   │   ├── basic_msg1.py
│   │   └── basic_msg2.py
│   └── basic_embed/
│       ├── basic_embed.py
│       ├── basic_embed1.py
│       └── basic_embed2.py
│
├── README.md
├── CONTRIBUTING.md
├── CHANGELOG.md
├── LICENSE
├── .gitignore
└── pyproject.toml
```

---

## Roadmap

### v1.0.0-beta *(current)*
- [x] Plain text messages
- [x] Rich embed support (full Discord embed spec)
- [x] `Color` helper with named constants and hex/RGB converters
- [x] Username & avatar URL overrides
- [x] Multi-embed messages (up to 10 per message)
- [x] Discord error details on failed requests

### v1.x.x *(planned)*
- [ ] Async support (`send_message_async`, `send_embed_async`)
- [ ] File / attachment sending
- [ ] Request timeout configuration
- [ ] Full documentation site

---

## Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions and guidelines.

---

## License

Distributed under the MIT License. See [LICENSE](LICENSE) for details.

---

## Contact & Support

- 🐛 **Bugs & feature requests:** [Open an issue](https://github.com/dj-kaif/dihook/issues)
- 💬 **Discord:** [dj.kaif](https://discord.com/users/1237644967422459996)
- 📦 **PyPI:** [pypi.org/project/webhook.py](https://pypi.org/project/dihook)

If webhook.py saves you time, consider ⭐ **[starring the repo](https://github.com/dj-kaif/dihook)** — it really helps!
