Metadata-Version: 2.4
Name: Simple-Notify-discord
Version: 0.1.2
Summary: Simple-Notify-discord allows you to simply send a message on Discord via a webhook, it allows you to alert when a process is finished or other depending on your context.
Author-email: CogalTek <mathieurio.contact@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Mathieu Rio (CogalTek)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Simple-Notify-Discord

https://pypi.org/project/Simple-Notify-discord/

**Simple-Notify-Discord** allows you to easily send a message to a Discord channel via a webhook.  
You can use it to alert when a process is finished, when an error occurs, or for any other context where you need simple notifications.

---

## Installation

```bash
pip install Simple-Notify-discord
```

---

## Usage

First, import the `SimpleNotifyDiscord` class:

```python
from simple_notify_discord import SimpleNotifyDiscord

notifier = SimpleNotifyDiscord()
notifier.notify_discord("✅ Your task is complete!", mention=True)
```

If you set `mention=True`, the user ID will be mentioned at the beginning of the message.

---

## How It Works

The class `SimpleNotifyDiscord` sends a message to your Discord server through a webhook URL.

Here's the internal structure:

```python
import requests

class SimpleNotifyDiscord:
    def __init__(self):
        self.webhook_url = "your webhook URL here"
        self.user_id = "your Discord user ID here"

    def notify_discord(self, message="Hey, this is a notification from Notify", mention=False):
        if mention:
            message = f"<@{self.user_id}> {message}"
        data = {"content": message}
        response = requests.post(self.webhook_url, json=data)
        if response.status_code == 204:
            print("✅ Notification Discord sent successfully")
        else:
            print(f"❌ Error: {response.text}")
```

---

## Setup

### 1. Create a Discord Webhook

- Go to your Discord server.
- Click **Server Settings** → **Integrations** → **Webhooks**.
- Click **New Webhook**.
- Choose the channel where you want notifications.
- Copy the webhook URL and paste it into your `SimpleNotifyDiscord` class (`self.webhook_url`).

### 2. Find your Discord User ID

If you want the bot to mention you:
- Enable **Developer Mode** in Discord (Settings → Advanced → Developer Mode).
- Right-click your profile → **Copy ID**.
- Paste this ID into your `SimpleNotifyDiscord` class (`self.user_id`).

> If `mention=True`, your notification will automatically tag you.

---

## Repository

The project is open-source and available here:  
[https://github.com/CogalTek/SimpleNotifyDiscord](https://github.com/CogalTek/SimpleNotifyDiscord)

---

## License

This project is licensed under the MIT License.  
See the [LICENSE](LICENSE) file for details.
