Academy · Lesson 3Academy · Lekcja 3

Rich embedsBogate embedy

Embeds are the tidy, colourful cards bots use for nice-looking messages. GiphyFy's /help is one. Here's how to build your own. Embedy to schludne, kolorowe karty, których boty używają do ładnie wyglądających wiadomości. /help w GiphyFy to właśnie embed. Oto jak zbudować własny.

English / Polski BeginnerPoczątkujący 4 min

01 What is an embed?Czym jest embed?

An embed is a structured, coloured message block — with a title, description, fields, a thumbnail and a footer. It's how bots present information cleanly instead of a wall of text.

Embed to uporządkowany, kolorowy blok wiadomości — z tytułem, opisem, polami, miniaturą i stopką. Tak boty prezentują informacje schludnie, zamiast ściany tekstu.

02 A basic embedPodstawowy embed

Create an Embed with a title, description and colour. discord.Color.blurple() gives you Discord's signature colour.

Utwórz Embed z tytułem, opisem i kolorem. discord.Color.blurple() daje charakterystyczny kolor Discorda.

python
import discord

embed = discord.Embed(
    title="GiphyFy",
    description="Turn messages into GIFs!",
    color=discord.Color.blurple(),
)

03 Fields & extrasPola i dodatki

Add small labelled sections with add_field (use inline=True to place them side by side), plus a footer and thumbnail.

Dodawaj małe, opisane sekcje za pomocą add_field (użyj inline=True, by umieścić je obok siebie), a także stopkę i miniaturę.

python
embed.add_field(name="Images", value="PNG, JPG, WEBP", inline=True)
embed.add_field(name="Videos", value="MP4, WEBM, MOV", inline=True)
embed.set_footer(text="GiphyFy • Crafting GIFs")

04 Send itWyślij go

Send an embed by passing it as the embed= argument — just like sending text.

Wyślij embed, przekazując go jako argument embed= — tak samo jak wysyłasz tekst.

python
@bot.tree.command(name="info", description="Show bot info")
async def info(interaction: discord.Interaction):
    await interaction.response.send_message(embed=embed)

GiphyFy's own /help is built exactly like this — a single embed with fields describing each feature.

Komenda /help w GiphyFy jest zbudowana dokładnie tak — to jeden embed z polami opisującymi każdą funkcję.

05 Test yourselfSprawdź się

Q1. How do you send an embed?Jak wysłać embed?
Pass the embed as the embed= keyword argument.Przekaż embed jako argument nazwany embed=.
Q2. What puts two fields side by side?Co umieszcza dwa pola obok siebie?
inline=True lets fields sit next to each other instead of stacking.inline=True sprawia, że pola stoją obok siebie zamiast jedno pod drugim.