Skip to main content

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.

PyPI Python License

🔧 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


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.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

simplehook-1.2.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file simplehook-1.2.0.tar.gz.

File metadata

  • Download URL: simplehook-1.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for simplehook-1.2.0.tar.gz
Algorithm Hash digest
SHA256 bcd321e1a05a360a1c0186c8b471a5a4f8c78793fb46290bb88911e622f83d79
MD5 9a02eb3dea23f2cc253e658317bd9e11
BLAKE2b-256 4aa8e6682a1f3516b1bf26b5f30d0c4f950bb51c65fd34b8fdc0d7ca43f4febe

See more details on using hashes here.

File details

Details for the file simplehook-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: simplehook-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for simplehook-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e0e5deaedd2639a9eb52c9620dd91533614881174592441a63de5d46ec269e
MD5 804cb57424516807d2ecf8cbffe2c491
BLAKE2b-256 fe4ff11ea9c60267d0d2e0b5718644340fa1803c79d5cd7b5efbda6f63d93d1b

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