Skip to main content

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 SettingsIntegrationsWebhooks.
  • 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


License

This project is licensed under the MIT License.
See the LICENSE file for details.

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

simple_notify_discord-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

simple_notify_discord-0.1.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for simple_notify_discord-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8cb137e4d5ea354c29623e86e89d9332ecb51fdb01df163fe1342985d7b515bf
MD5 baa11f72e2245ead1e8d76d2661effb7
BLAKE2b-256 f7202a2179a1f20d5e5b54fbd9de7fbe48bb81a3849fc7a93c4dc9ea14ab5147

See more details on using hashes here.

File details

Details for the file simple_notify_discord-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_notify_discord-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 903ceb5357eb3abf28f33bcf91e7824c9b197afbb4075f51a5c3bdea7a1c7b00
MD5 f9609119da7967da17276f3f61b0c73f
BLAKE2b-256 add9f00b9c9997e94725d4e1abdf1fe897b7de405d7f6000471beff504b6fd30

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