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.
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
- Homepage: https://github.com/Fmasterpro27/DCHook
- Issues: https://github.com/Fmasterpro27/DCHook/issues
- PyPI: https://pypi.org/project/dchook/
License
Licensed under the Apache License 2.0.
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
dchook-1.0.0.tar.gz
(7.7 kB
view details)
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 dchook-1.0.0.tar.gz.
File metadata
- Download URL: dchook-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9895687b3377e753938f6b88017a27a4c25c4ba277f7b7a3eb7b38cb2cc6418c
|
|
| MD5 |
3dc19b09a5e63507b7eceb1becb2b8ec
|
|
| BLAKE2b-256 |
65f74e51e6ee423f8eb6c491b4fa6f25baf7e5470b8248a50147171164915532
|
File details
Details for the file dchook-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dchook-1.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1245abf11ac4ccfbd9c665a97d20002c24e21f3e5fc89e0286c886a0d6929a3
|
|
| MD5 |
14fe502877600c218c3ce0ee74f1e9d5
|
|
| BLAKE2b-256 |
cd1b7818d62bfbe46c8ad34cdaf52648e6f873e5d905f6e5d02b2c8fbab329fb
|