Skip to main content

Sending message notification to Discord, Telegram, Slack

Project description

TP-sendNotify

Installation

From PyPI:

pip install TP-sendNotify

From Source:

git clone https://github.com/truocphan/TP-sendNotify.git --branch <Branch/Tag>
cd TP-sendNotify
python setup.py build
python setup.py install

Basic Usage

The default configuration file created at ~/.TPConfig/TP-sendNotify/sendNotify.json has the following content:

{
    "Discord": {
        "<BOT_NAME>": {
            "WEBHOOK-URL": "https://discord.com/api/webhooks/<WEBHOOK_ID>/<WEBHOOK_TOKEN>"
        },
        ...
    },
    "Telegram": {
        "<BOT_NAME>": {
            "BOT-TOKEN": "<BOT_TOKEN>",
            "CHANNEL-USERNAME": "<CHANNEL_USERNAME>"
        },
        ...
    },
    "Slack": {
        "<BOT_NAME>": {
            "WEBHOOK-URL": "https://hooks.slack.com/services/<WORKSPACE_ID>/<CHANNEL_ID>/<TOKEN>"
        },
        ...
    }
}

toDiscord(bot_name, message, SidebarColor=0xcc0500, ConfigFile=None)

Sending message notification to Discord

import TP_sendNotify

TP_sendNotify.toDiscord("<BOT_NAME>", "This message notification has been sent to the Discord using TP-sendNotify")

toTelegram(bot_name, message, MessageFormat=None, ConfigFile=None)

Sending message notification to Telegram

import TP_sendNotify

TP_sendNotify.toTelegram("<BOT_NAME>", "This message notification has been sent to the Telegram using TP-sendNotify")

toSlack(bot_name, message, ConfigFile=None)

Sending message notification to Slack

import TP_sendNotify

TP_sendNotify.toSlack("<BOT_NAME>", "This message notification has been sent to the Slack using TP-sendNotify")

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

TP-sendNotify-2024.9.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distributions

TP_sendNotify-2024.9.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

TP_sendNotify-2024.9.1-py2-none-any.whl (4.0 kB view details)

Uploaded Python 2

File details

Details for the file TP-sendNotify-2024.9.1.tar.gz.

File metadata

  • Download URL: TP-sendNotify-2024.9.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.10

File hashes

Hashes for TP-sendNotify-2024.9.1.tar.gz
Algorithm Hash digest
SHA256 ce8ba7e0c726d09e0cb396ac3da6a962f9e7942f66d934b5201ff01761c6342d
MD5 410613e351c8b18895cf8528004c5dba
BLAKE2b-256 01d4ac3dcb3632c262af4dbb13305d4e597f26c4d6bac5f01e4e7c1e6e11f5a2

See more details on using hashes here.

File details

Details for the file TP_sendNotify-2024.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for TP_sendNotify-2024.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b67a6ffe32d982c397b416526f9ff5f3a9d0ba54603b9dae1bafdcae53a133b4
MD5 a306368f4ea3972c0a76c0adb10d9d2b
BLAKE2b-256 906d8396979d5bcf5a444b09b2fc638909cabf1c2ec1a5b3a54f1ce2686c2ced

See more details on using hashes here.

File details

Details for the file TP_sendNotify-2024.9.1-py2-none-any.whl.

File metadata

File hashes

Hashes for TP_sendNotify-2024.9.1-py2-none-any.whl
Algorithm Hash digest
SHA256 f4893fac111a5aafa15ce3b42115838d7278267cbaa83cdb583509d6b04e826c
MD5 4622bde2a5877c21b84d5ab7e00e2db5
BLAKE2b-256 36e5ee88af13001894f0d203325ac01a76426afe94832578cb9213844a08db81

See more details on using hashes here.

Supported by

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