Skip to main content

Easily using discord webhooks in python - asynchronous and synchronous - documented at https://discordwebhook.readthedocs.io/en/latest/

Project description

A simple python package for posting to discord webhooks in python
Has asynchronous and synchronous options

Example

from discordwebhook import create # Import discordwebhook create

webhook = create.Webhook("WEBHOOK_URL") # Create Webhook object, url can be in webhook.send() instead, however is reccomended here
embed = create.Embed() # Create embed object

webhook.username("Example Webhook") # Override webhook username as 'Example Webhook'
webhook.message("Hello! This is a message from an example webhook with the `discordwebhook.py` library!") # Message to go with the embed

embed.title("Github Logo") # Embed title as 'Github Logo'
embed.image(url="https://image.flaticon.com/icons/png/512/25/25231.png") # Embed image as github logo
embed.color(0x808080) # Gray embed color

webhook.send(embed=embed) #Send webhook to given link with the embed

0.1.0 to 0.1.2 Changelog

Fixed asyncCreate not returning any values
Added error handling for invalid token in fetching webhooks
Added error handling for no provided url
Added ability for setting webhook link prior to sending it, adding a link to the create.Webhook object
Added alias discordwebhook.use for discordwebhook.create and discordwebhook.asyncUse for discordwebhook.asyncCreate
Many changes to documentation and other things
Fixed version number isseus with 0.1.0
Added ability to set username and avatar_url in Webhook().send() with alias author

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

discordwebhook.py-0.1.2.tar.gz (4.2 kB view hashes)

Uploaded Source

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