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.
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ę.
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.
@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ę
embed= keyword argument.Przekaż embed jako argument nazwany embed=.inline=True lets fields sit next to each other instead of stacking.inline=True sprawia, że pola stoją obok siebie zamiast jedno pod drugim.