Skip to main content

A lightweight Python library and CLI for sending messages through Discord webhooks.

Project description

DCHook

A lightweight Python library and CLI for sending messages through Discord webhooks.

PyPI version Python versions License


Features

  • Send messages through Discord webhooks
  • Simple Python API
  • Command Line Interface (CLI)
  • Lightweight and easy to use
  • Minimal dependencies
  • Fast and reliable
  • Python 3.8+

Installation

pip install dchook

Quick Start

from dchook import send

send(
    "YOUR_WEBHOOK_URL",
    "Hello from DCHook!"
)

Python API

Send a Message

from dchook import send

send(
    "YOUR_WEBHOOK_URL",
    "Hello World!"
)

Using the Webhook Class

from dchook import Webhook

hook = Webhook("YOUR_WEBHOOK_URL")

hook.send("Hello World!")
hook.send("Another message!")

CLI Usage

Send a Message

dchook "Hello World!" -w YOUR_WEBHOOK_URL

Using an Environment Variable

Linux/macOS:

export DCHOOK_WEBHOOK="YOUR_WEBHOOK_URL"

dchook "Hello World!"

Windows PowerShell:

$env:DCHOOK_WEBHOOK="YOUR_WEBHOOK_URL"

dchook "Hello World!"

Show Version

dchook --version

Example

from dchook import send

send(
    "https://discord.com/api/webhooks/...",
    "Deployment completed successfully."
)

Testing

pytest

Requirements

  • Python 3.8+
  • requests

License

Apache License 2.0


Author

Developed by JackMa

GitHub: https://github.com/Fmasterpro27


Links


License

Licensed under the Apache License 2.0.

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

dchook-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

dchook-1.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file dchook-1.0.1.tar.gz.

File metadata

  • Download URL: dchook-1.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for dchook-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9ecb2d653a755faff1c70770ee6da34b194675e841e42115fe6834f80b9103a4
MD5 931b04c377d1dd08b1ccbcef46014f5e
BLAKE2b-256 8f6ac15f311647bc4773d9379993cd844804bc66f461cab399933ed9764b30d5

See more details on using hashes here.

File details

Details for the file dchook-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dchook-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for dchook-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30d9a5dfdce422f6a2c00b985cbae92b7d11496c5bf5560f09cc96e8ed27fa6b
MD5 a2e7d5e50e930699e8b1afef685d9b80
BLAKE2b-256 49d0794d68390ff8f2bc0e059d4d5403d5e5cc748e06f37bae290fa741a0b57c

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