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 hashes)
Built Distribution
Close
Hashes for embed_builder-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f496585f97dbd476ded8ae2942cd64202c2acdd544c3af3d447e4e8184a63610 |
|
MD5 | ac5f2b8c227a843c1122cda4a42cdb55 |
|
BLAKE2b-256 | d4ab9000790f9e921390611d4f729e3d0644f470ccb869ffdd8b7100be61cefe |