Python in Plain English

New Python content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Tutorial | Python | Discord.py

Send an Embed with a Discord Bot in Python

Upgrade your bot’s messages and make them a little more custom using embeds!

Drew Seewald
Python in Plain English
7 min readNov 24, 2020

--

Title card by the author

When your Discord bot responds to your server, you don’t always want a boring default message to be sent back. Maybe you have links or images that you want to send back in chat. With Python and Discord.py, this is super easy to do in your Discord bot!

Note: This is tested on version 1.4.1 of the Discord.py module. You will encounter issues if you are using a version lower than 1.0. It is recommended that you migrate your code to a more current version.

Building Embeds

Embeds in Discord are simple and have a very clean, formatted look to them. In this tutorial we will go through how to create an embed and customize every part of it.

The embed below is similar to what we will be making. It has a lot going on. There are multiple pictures, links, and text fields that we are able to edit.

You’ll know how to make this embed by the end of the tutorial!

Creating the Initial Embed

Title, Description, and color (color is the bar to the left side)

When creating an embed, you need to initialize an embed object using the Embed() function from the discord package. We will be using 4 arguments to get started:

  1. title: a string to set the title. This is the first line on our blank embed
  2. url: a string to set the link for the title. When you click on title in the final embed it will take you to this link
  3. description: a string to set the description. This is the darker 2 red lines above
  4. color: a color object. This will color…

--

--

Published in Python in Plain English

New Python content every day. Follow to join our 3.5M+ monthly readers.

Responses (4)