Skip to main content

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

  1. Create a .env file in your project root directory
  2. Add your Discord webhook URL to the .env file:
    WEBHOOK_URL=your_discord_webhook_url_here
    
  3. 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:

  1. Go to your Discord server
  2. Right-click on the channel you want to send messages to
  3. Click 'Edit Channel'
  4. Click 'Integrations'
  5. Click 'Create Webhook' (or 'View Webhooks' if you already have one)
  6. Click 'New Webhook'
  7. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dugudugu_discord_notifier-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dugudugu_discord_notifier-0.2.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

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

Hashes for dugudugu_discord_notifier-0.2.0.tar.gz
Algorithm Hash digest
SHA256 23b6403f49b19de266cd997b2621d3b0bafd0de501d61a2bbcaeb3eb25cfa2e9
MD5 7a9fb0cb2b13a1f1865077c05d2b1b8d
BLAKE2b-256 12830d8b3a2671613eeb9ee5817f023e3458636e80c006e83af0c497656feaf8

See more details on using hashes here.

File details

Details for the file dugudugu_discord_notifier-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dugudugu_discord_notifier-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45eb37018820cb1c27eb048ab040332f0afbe921a60104d7627cd93d1795d93a
MD5 5c36a36bd46a0f7615785402a549d8ca
BLAKE2b-256 707914e38b74dcbc965738c635e995ca9b037c6aeecf0799ad0b14fcc725b557

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page