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.
Project description
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
pip install Simple-Notify-discord
Usage
First, import the SimpleNotifyDiscord class:
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:
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
SimpleNotifyDiscordclass (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
SimpleNotifyDiscordclass (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
License
This project is licensed under the MIT License.
See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_notify_discord-0.1.2.tar.gz.
File metadata
- Download URL: simple_notify_discord-0.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cb137e4d5ea354c29623e86e89d9332ecb51fdb01df163fe1342985d7b515bf
|
|
| MD5 |
baa11f72e2245ead1e8d76d2661effb7
|
|
| BLAKE2b-256 |
f7202a2179a1f20d5e5b54fbd9de7fbe48bb81a3849fc7a93c4dc9ea14ab5147
|
File details
Details for the file simple_notify_discord-0.1.2-py3-none-any.whl.
File metadata
- Download URL: simple_notify_discord-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
903ceb5357eb3abf28f33bcf91e7824c9b197afbb4075f51a5c3bdea7a1c7b00
|
|
| MD5 |
f9609119da7967da17276f3f61b0c73f
|
|
| BLAKE2b-256 |
add9f00b9c9997e94725d4e1abdf1fe897b7de405d7f6000471beff504b6fd30
|