Skip to main content

Python package to interact with Discord webhooks

Project description

Happyhooks

Happyhooks is a Python package that simplifies interaction between Discord webhooks!
You can do things in this package such as:

  1. Send/Edit/Delete messages
  2. Create Discord embeds
  3. Send files/attachments too!

Happyhooks is also asynchronous, using the aiohttp Python library so this doesn't block your whole script, and lets you also use this in Python libraries like discord.py!

Usage Examples

Here are some quick examples on how you can use this package:

  • Sending normal text messages:
import hphooks

# Assuming the rest is in an async function!
webhook = hphooks.Webhook('YOUR_WEBHOOK_URL')

await webhook.send('Hello world!') # Quick shortcut I made for basic text messages!
  • Sending basic / rich Discord embeds:
import hphooks

webhook = hphooks.Webhook('YOUR_WEBHOOK_URL')

embed = hphooks.Embed(
    title='My **COOL** embed😎',
    description='This is my very cool embed😎😎',
    color='COLOR_HEXCODE' # Defaults to #ffffff (White)!
)
rich_embed = hphooks.RichEmbed(
    title='My **COOLER** embed😎',
    url='https://example.com', # Adds a link that opens when you click the embed title!
    description='This is my more cooler embed😎😎',
    color='COLOR_HEXCODE'
)
rich_embed.set_footer('Happyhooks Rich Embed', icon_url='YOUR_IMAGE_URL')
rich_embed.set_author('Happyhooks', url='https://discord.com', icon_url='YOUR_IMAGE_URL')

rich_embed.add_field(
    name='My field',
    value='This is my field!',
    inline=True
)

message = hphooks.Message('Look at my embeds!', embeds=[embed, rich_embed])
await webhook.send(message)
  • Sending Discord attachments:
import hphooks

webhook = hphooks.Webhook('YOUR_WEBHOOK_URL')

example_image = hphooks.File(fp='your/image/file/path (will be pathlibbed)', filename='example.png')
message = hphooks.Message('Look at my image file!')
await webhook.send(message, files=[example_image])
  • Editing / Deleting webhook messages:
import hphooks
import asyncio

webhook = hphooks.Webhook('YOUR_WEBHOOK_URL')

sentmessage = await webhook.send('Example') # This returns a SentMessage object, and it'll be very important here!
print('Sent first message, editing it in a few seconds..')

await asyncio.sleep(2.0)

await webhook.edit(sentmessage, 'Edited example!') # Shortcut for only editing the content itself too!
print('Edited message! Now deleting in a few seconds..')

await asyncio.sleep(2.0)

await webhook.delete(sentmessage) # Ofcourse, deletes the webhook message!
print('Deleted message!')

All coded by me

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

happyhooks-0.1.0.tar.gz (104.6 kB view details)

Uploaded Source

Built Distribution

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

happyhooks-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file happyhooks-0.1.0.tar.gz.

File metadata

  • Download URL: happyhooks-0.1.0.tar.gz
  • Upload date:
  • Size: 104.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.14.5"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.0.20 7 Apr 2026","python":"3.14.5","system":{"name":"Windows","release":"10"}} HTTPX2/2.5.0

File hashes

Hashes for happyhooks-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9a3b0e3d388590f1daf2d0c1208c960e7aa153723553255f2dd43153e66e8fad
MD5 ed394c2367920964efb81e559f9d5824
BLAKE2b-256 9ddfaaafff652e81b7038b0b4fb0858ab8b53074459106c3ceb62a905fb6656a

See more details on using hashes here.

File details

Details for the file happyhooks-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: happyhooks-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.14.5"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.0.20 7 Apr 2026","python":"3.14.5","system":{"name":"Windows","release":"10"}} HTTPX2/2.5.0

File hashes

Hashes for happyhooks-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4e98bb16353bbc348a745d2922b41ab850656eeb41a42f11fdbf7b0f4d6c03f
MD5 cf4232f231c4ee085fb597da5201d1d7
BLAKE2b-256 911a4db2be10ce14263612d0986a79d4bc5fed94760db62d0853287ef6e57d9f

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