A simple Discord notification tool using webhooks
Project description
Discord Notifier
A simple Python package for sending notifications to Discord channels using webhooks.
Installation
pip install dugudugu-discord-notifier
Usage
There are two ways to use this notifier:
Method 1: Direct webhook URL
from notifier.discord_notifier import DiscordNotifier
# Initialize with webhook URL
notifier = DiscordNotifier("your-webhook-url-here")
# Send messages
notifier.send_message("Hello, World!")
notifier.send_message("This is the message content", "This is the title")
Method 2: Using environment variables
- Create a
.envfile in your project root directory - Add your Discord webhook URL to the
.envfile:WEBHOOK_URL=your_discord_webhook_url_here
- Use the notifier:
from notifier.discord_notifier import DiscordNotifier # Initialize (will read from .env file) notifier = DiscordNotifier() # Send messages notifier.send_message("Hello, World!") notifier.send_message("This is the message content", "This is the title")
How to get Discord Webhook URL:
- Go to your Discord server
- Right-click on the channel you want to send messages to
- Click 'Edit Channel'
- Click 'Integrations'
- Click 'Create Webhook' (or 'View Webhooks' if you already have one)
- Click 'New Webhook'
- Copy the Webhook URL
Features
- Simple and easy to use
- Supports markdown formatting
- Flexible configuration (direct URL or environment variables)
- Timeout handling
- Error reporting
Requirements
- Python 3.7+
- requests
- python-dotenv
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 dugudugu_discord_notifier-0.2.0.tar.gz.
File metadata
- Download URL: dugudugu_discord_notifier-0.2.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b6403f49b19de266cd997b2621d3b0bafd0de501d61a2bbcaeb3eb25cfa2e9
|
|
| MD5 |
7a9fb0cb2b13a1f1865077c05d2b1b8d
|
|
| BLAKE2b-256 |
12830d8b3a2671613eeb9ee5817f023e3458636e80c006e83af0c497656feaf8
|
File details
Details for the file dugudugu_discord_notifier-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dugudugu_discord_notifier-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45eb37018820cb1c27eb048ab040332f0afbe921a60104d7627cd93d1795d93a
|
|
| MD5 |
5c36a36bd46a0f7615785402a549d8ca
|
|
| BLAKE2b-256 |
707914e38b74dcbc965738c635e995ca9b037c6aeecf0799ad0b14fcc725b557
|