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() # Create Webhook object
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("WEBHOOK_URL", embed=embed) #Send webhook to given link with the embed

0.0.7 and 0.0.8 Changelog

Added discordwebhook.discordwebhook
discordwebhook.fetch.Webhook() now supports a Webhook() object instead of just string
Changed discordwebhook.discordwebhook.version.recent to current with alias recent
When using webhooks set information is stored in variables and can be accessed later by using (webhook).(setData), for example webhook.message
Added message and tts kwarg to .send to allow for one line webhook sends
Added kwargs to embed creation to create an experience identical to discord.py
Added docstrings at the top of files
Started error handling for embeds, checks on send to keep projects working
Fixed fatal error which occured with all embeds after 0.0.7

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.0.8.tar.gz (4.0 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