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

Uploaded Source

Built Distribution

pywebhk-1.0.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pywebhk-1.0.4.tar.gz
  • Upload date:
  • Size: 6.4 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.4.tar.gz
Algorithm Hash digest
SHA256 91c409deb297f48cfb4c9e309cc9cea0719cf579cbdac67d0f5ff464adb2cb3e
MD5 603d17faf590166d10651ad661f315d4
BLAKE2b-256 d771442c4cff16dacd801c5f44299f1cd4efc8aa368c8f2788e83cfc528bed01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pywebhk-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cb99e6e2457a93917f42d8c1ddb498a570c7c6c2b63f7aca9ccf3019a5817d
MD5 822cbe14933134e492c895c80a9fd85a
BLAKE2b-256 95d9771189c6b1b729ed3e59b2495f60adb4bfd17f1ba736b12d9ea78202fcf5

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