Embeds
Discord embeds are the classic rich-content cards: title, description, color, fields, images. cordless’s Embed builder is chainable:
from cordless import Embed
embed = ( Embed(title="Server Stats", description="Live numbers", color=0x5865F2) .set_author("MyBot", icon_url="https://example.com/icon.png") .add_field("Members", "1,204", inline=True) .add_field("Online", "312", inline=True) .set_footer("Updated just now") .set_image("https://example.com/banner.png"))
@bot.command("stats", description="Show server stats")async def stats(ctx): await ctx.send(embeds=[embed])Reference
Section titled “Reference”Embed(title=None, description=None, color=None, url=None, timestamp=None): color is an integer, e.g. 0x5865F2; timestamp accepts a datetime or an ISO 8601 string.
| Method | Adds |
|---|---|
.set_author(name, url=None, icon_url=None) |
Author line above the title |
.set_footer(text, icon_url=None) |
Footer text and icon |
.set_image(url) |
Large image at the bottom |
.set_thumbnail(url) |
Small image, top-right |
.add_field(name, value, inline=False) |
One field, call repeatedly to add more |
Each setter returns the embed itself, so calls chain in any order.
Pass one or more embeds to any response method: ctx.send(embeds=[...]), ctx.edit(embeds=[...]), ctx.followup(embeds=[...]), ctx.send_followup(embeds=[...]), or bot.send_message(channel_id, embeds=[...]) from a cron handler.
