Easily build Discord Embed dictionaries
Project description
embed_builder
I got tired of manually writing dictionaries to send embeds via Discord webhooks, so I made this package to do it effortlessly.
This package was developed on Python 3.10.x but has not been tested on earlier versions. If you happen to successfully use this package on an older version then do let me know.
Installation
$ pip install embed-builder
Usage
from embed_builder import Embed
embed = Embed()
embed.set_title("Hello")
embed.set_description("How are you?")
embed.set_color("#ff69b4")
# New in 1.4.0 - Validating embed limits - https://discord.com/developers/docs/resources/channel#embed-object-embed-limits
if not embed.is_valid():
raise Exception("woops! embed has exceeded Discord's limits")
my_embed = embed.build()
# Or via chaining...
my_embed = Embed().set_title("Hello").set_description("How are you?").build()
# Example usage with Discord webhooks and requests package
requests.post("webhook url", json={
"content": "here is an embed",
"embeds": [my_embed]
})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
embed-builder-1.4.0.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file embed-builder-1.4.0.tar.gz
.
File metadata
- Download URL: embed-builder-1.4.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c3d8224d2611cc0e0a844d3a2535bba1aaf4549cb35a06f1c77aad4a859311 |
|
MD5 | 44a17c13061f3d384d1b79a49e280e12 |
|
BLAKE2b-256 | c75d47953d29ed1c6dcdfbe34c13e79ce97f7f3bff1f844e38448ffe13e8a82e |
File details
Details for the file embed_builder-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: embed_builder-1.4.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f496585f97dbd476ded8ae2942cd64202c2acdd544c3af3d447e4e8184a63610 |
|
MD5 | ac5f2b8c227a843c1122cda4a42cdb55 |
|
BLAKE2b-256 | d4ab9000790f9e921390611d4f729e3d0644f470ccb869ffdd8b7100be61cefe |