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.1.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.1.tar.gz.
File metadata
- Download URL: simplehook-1.1.1.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 |
caa142c6cd038ae7379e62bc552a28316cad192e5d1270880bb2bee345443c7e
|
|
| MD5 |
6940670fa36552cc822b8dc19adfa97c
|
|
| BLAKE2b-256 |
dab8c96abe99dacbce5af116b3f2f10c9a290af6b4b829aabf42a9fafb43e273
|
File details
Details for the file simplehook-1.1.1-py3-none-any.whl.
File metadata
- Download URL: simplehook-1.1.1-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 |
65f1ff8408785a94743ff3c6c47384e103df5c146311297cc7468cc34f06317c
|
|
| MD5 |
007eefb7197a97141b5ac5e0e70a6995
|
|
| BLAKE2b-256 |
4a3b3199f44223ac660cafb4129256357426d31e8090965a8ab3c6b3824a4944
|