Skip to main content

An ultra small Discord webhook handler

Project description

Pywebhk

Pywebhk (pronounced Py-webhook) is an ultra-small Discord webhook handler that allows you to create webhook messages quickly and easily. It provides a simple-to-use interface with methods and classes for handling webhooks.

license python discord-webhook-handler

Features

  • Create and send webhook messages with ease.
  • Support for embedding rich content in your messages.
  • Lightweight and easy to integrate into your projects.
  • Compatible with Python 3.6 and above.

Installation

You can install Pywebhk using pip:

pip install pywebhk

Usage Example

from pywebhk.webhook import Webhook
from pywebhk.embed import Embed

webhook_url = "WEBHOOK_URL"
hook = Webhook(webhook_url)

hook.set_content("Hello from main.py!")
hook.set_name("My Webhook")
hook.set_avatar("https://example.com/avatar.png")

embed = Embed(title="My Cool Embed", description="This is a sample embed from main.py.", color=0xFF5733)
embed.set_author(name="Author Name", icon_url="https://example.com/author.png")
embed.add_field(name="Field A", value="Value A", inline=False)
embed.add_field(name="Field B", value="Value B", inline=True)
embed.set_footer(text="Footer text from a really cool embed")

hook.add_embed(embed)

try:
    hook.send()
    print("Webhook message sent successfully from main.py!")
except Exception as e:
    print("Error sending webhook message from main.py:", e)

TODO

  • Add File Support
  • Some Error Handling Done
  • Minor Documentation Done

License

This project is licensed under the MIT License.

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

pywebhk-1.0.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

pywebhk-1.0.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file pywebhk-1.0.3.tar.gz.

File metadata

  • Download URL: pywebhk-1.0.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pywebhk-1.0.3.tar.gz
Algorithm Hash digest
SHA256 673ede1ee01c1491e536753cb4863fb62fbcac1a9567a4d338e28f7056b889a4
MD5 272ea5e83ef71481a4d49819426da843
BLAKE2b-256 b44e66d375316bfc1b7b485c3463cf523ebeb6fe5a0591e4884723b2ae42d73a

See more details on using hashes here.

File details

Details for the file pywebhk-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pywebhk-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pywebhk-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 74387ace6c2682c434b5fe4859b4d5ef7f415e04f756df3ed542f7c994830344
MD5 cdad7f3ecb4a4a46c94c651b79b6d0ab
BLAKE2b-256 59cdbe6cb06b036dffaec9d5c19f633c86bb9a4e8f2e81a76972d02361546e0e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page