easy-discord-webhooks
An easy and simplistic way to execute and modify a Discord webhook all from Python.
Install
pip install easy-discord-webhooks
Examples
Sending hello world to a webhook.
import easy_discord_webhooks as DiscordWebhooks # Import easy-discord-webhooks as something easy to refer back to.
webhookUrl = "WEBHOOK_URL_HERE"
webhook = DiscordWebhooks.Webhook(webhookUrl) # Create a new webhook object with your webhook URL.
webhook.send("Hello World") # Send a hello world to the webhook using the objects send function.
Sending a basic embed to a webhook.
import easy_discord_webhooks as DiscordWebhooks # Import easy-discord-webhooks as something easy to refer back to.
webhookUrl = "WEBHOOK_URL_HERE"
webhook = DiscordWebhooks.Webhook(webhookUrl) # Create a new webhook object with your webhook URL.
embed = DiscordWebhooks.Embed( # Create an embed object.
title="Embed Title", # Set the title
description="Embed description...", # Set the description
color="#ff0000" # Set the color (must be a hex value)
)
webhook.send("Hello World", embed=embed) # Send a hello world + the embed to the webhook using the objects send function.
Sending an advanced embed with fields and images to a webhook.
import easy_discord_webhooks as DiscordWebhooks # Import easy-discord-webhooks as something easy to refer back to.
webhookUrl = "WEBHOOK_URL_HERE"
webhook = DiscordWebhooks.Webhook(webhookUrl) # Create a new webhook object with your webhook URL.
embed = DiscordWebhooks.Embed( # Create an embed object.
title="Embed Title", # Set the title
description="Embed description...", # Set the description
color="#ff0000" # Set the color (must be a hex value)
)
# Add fields using add_field function
embed.add_field(name="Field 1", value="Field 1 value.")
embed.add_field(name="Field 2", value="Field 2 value.")
embed.add_field(name="Field 3", value="Field 3 value.")
# Set an image with set_image
embed.set_image(url="https://discord.com/assets/ff41b628a47ef3141164bfedb04fb220.png")
# Set a thumbnail image with set_thumbnail
embed.set_thumbnail(url="https://discord.com/assets/f9bb9c4af2b9c32a2c5ee0014661546d.png")
webhook.send("Hello World", embed=embed) # Send a hello world + the embed to the webhook using the objects send function.
Gather info about a webhook.
import easy_discord_webhooks as DiscordWebhooks # Import easy-discord-webhooks as something easy to refer back to.
webhookUrl = "WEBHOOK_URL_HERE"
webhook = DiscordWebhooks.Webhook(webhookUrl) # Create a new webhook object with your webhook URL.
# get some information from the webhook
username = webhook.name
id = webhook.id
avatar = webhook.avatar
token = webhook.token
# other variables that could come in handy
guildId = webhook.guildId
channelId = webhook.channelId
applicationId = webhook.applicationId
type = webhook.type
# print the information we got from the webhook
print("Webhook name:", username)
print("Webhook id:", id)
print("Webhook token:", token)
print("Webhook avatar:", avatar)
Metadata
Release files for easy-discord-webhooks 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easy-discord-webhooks-1.0.2.tar.gz | 3.2 kB | Without provenance | Details for easy-discord-webhooks-1.0.2.tar.gz |
Release files / easy-discord-webhooks-1.0.2.tar.gz
| Download URL | easy-discord-webhooks-1.0.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2c31de8cad0f25876f11fa16019b8fb07769cbd165022c8aa412a7a46d6ac6b
|
|
BLAKE2b-256 checksum How to use checksums |
3e75970867ffd475d0344173acf5aa1d6a8e8c5743f4cab60c82a5b069bd9761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
|
Security for easy-discord-webhooks 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.