Simple Discord webhook wrapper
Project description
SimpleHook
SimpleHook is a minimalistic Python wrapper for Discord webhooks. It allows you to easily send messages, files, and embedded images to a Discord channel using just a few lines of code.
🔧 Features
- Send plain text messages
- Customize username and avatar
- Mention users or everyone/here
- Use Text-to-speech
- Upload files and images
- Embed multiple images (up to 10)
- Create and send polls
🚀 Usage
from simplehook import SimpleHook
# Initialize with your webhook URL
hook = SimpleHook("https://discord.com/api/webhooks/your_webhook_url")
# Send a simple message
hook.send_message("Hello, world!")
# Send a message with a custom username,avatar and Text-to-speech
hook.send_customized_message(
message="I'm a bot!",
username="CoolBot",
avatar_url="https://i.imgur.com/your_avatar.png",
tts=True
)
# Mention a user by ID or everyone/here
hook.send_customized_message("Look here!", mention="123456789012345678") # user mention
hook.send_customized_message("Attention!", mention="everyone") # @everyone
# Send a file
hook.send_file("example.txt")
# Send embedded images (max 10)
hook.send_embedded_images(["img1.png", "img2.jpg"], message="Check these out!")
# Create and send a poll
hook.create_poll(
question="What's your favorite color?",
answers=["Blue", "Red", "Green"],
emojis=["🔵", "🔴", "🟢"],
duration=48,
allow_multiselect=True
)
📦 Installation
pip install simplehook
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
simplehook-1.1.2.tar.gz
(4.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 simplehook-1.1.2.tar.gz.
File metadata
- Download URL: simplehook-1.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecef28f47b8c90d30476217f3a71726b0697b40e0b6edd70ea9b796cdf61f4d9
|
|
| MD5 |
dfea5d4fa825cdb57550f77e9bdebbe8
|
|
| BLAKE2b-256 |
e2c9b1451209cd373f5da1ed460b07923fa4aeb9f20c622c6d80fe0288dde3d2
|
File details
Details for the file simplehook-1.1.2-py3-none-any.whl.
File metadata
- Download URL: simplehook-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fc415b89921b155a4ba7cf8a25618cabeccce377949a67481b80f2e1c1bdacf
|
|
| MD5 |
a373ebe3fa262c06433d21cb6c764678
|
|
| BLAKE2b-256 |
78c8069a718ae19a68f19d2eab3ef59bda0ef63f8830a04fa0d4c0d9c1896d4a
|