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
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==0.1.0
Usage
First, set up the Simple-Notify-discord class:
import requests
class Notify:
def __init__(self):
self.webhook_url = "your webhook URL here"
self.user_id = "your Discord user ID here"
def Simple_Notify_discord(self, message="Hey this is a notification from Notify", mention=False):
if mention:
message = 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("❌ Error:", response.text)
Example
notifier = Simple_Notify_Discord()
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.
Setup
1. Create a Discord Webhook
- Go to your Discord server.
- Click on the server settings → Integrations → Webhooks.
- Click New Webhook.
- Choose the channel where the messages will be sent.
- Copy the webhook URL and paste it into your
Simple_Notify_Discordclass (self.webhook_url).
2. Find your Discord User ID
If you want the bot to mention you:
- Enable Developer Mode in Discord settings (Settings → Advanced → Developer Mode).
- Right-click on your profile and select Copy ID.
- Paste this ID into your
Simple_Notify_Discordclass (self.user_id).
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.1.tar.gz.
File metadata
- Download URL: simple_notify_discord-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0f2332023153bb4d41ee7ac4754f40030cfc9d6d0c82dc09bffeb74c6717691
|
|
| MD5 |
74d548e643f3c14c68facf24ca5f343b
|
|
| BLAKE2b-256 |
c9ea06c025a110a778a023e14d8426a578076bffd03cb0f9a32d9bbf2ec735fe
|
File details
Details for the file simple_notify_discord-0.1.1-py3-none-any.whl.
File metadata
- Download URL: simple_notify_discord-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.4 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 |
8b0073a3d2ac472b41721a8ef194f130d070fefbabb4d3c6c8ce5d583f488080
|
|
| MD5 |
58ea279b20567009e37ea9b0b280d2dc
|
|
| BLAKE2b-256 |
66ad0cd02e6075b79ee06def935c748dd06d0d1e884c418087dc7e4afbff3dc3
|