Scripting embed code

Learn here how to script embed code for commands that support this feature.

Embed builder

Bleed's website now has an embed building tool. If you don't feel like typing out embeds manually anymore, you can go here to use the new embed builder. You'll be greeted with the page below, where you can change any embed parameter you desire. When you've finished designing, press the Generate Embed Code button to the left, and then press the Copy Embed Code button to copy the output code to your clipboard.

Create your embed properly

To create your embed, you must know what parameters are and how they are used in embed code. There are two options for creating embeds, both of which are explained in detail below. Please refer to:

pageParameterspageVariables

Of course, you can still write all of your embeds without the builder. In the screenshot below, the embed parameters being used are title, description, color, author, footer, url, field (name & value), and timestamp. These parameters are parts of the embed where you will specifically insert content - so it's important to know these parameters to know where they are placed.

Explaining and writing embed code

Writing your embed code out is fairly simple, you can look at an example of embed code being written to get a basic understanding of embed code structure at first glance then proceed reading further down.

{title: Hello, this is a title}$v{description: something will go heree}

We already know that title and description are parameters in embed code, now we have to learn the structure and what type of content is accepted for these parameters in order to progress.

Structure and accepted content for parameters

Your embed code will first begin with a left curly bracket { to begin your first parameter, so now that you understand that the left curly bracket is essential at the start, it's time to understand what kind of content is allowed for your parameter. For an example, the title parameter allows a raw string and the color parameter will only allow hex codes.

Before progressing any further, you should go over what type of content is accepted for each parameter.

pageParameters

After going over what type of content parameters take, you are ready to finish your first parameter. Again, your embed code will have your first parameter that will start with {. Next, you need to specify what type of parameter you would like to pass. Let's start with a basic parameter: description - this takes a raw string; pretty straight forward. Write out this parameter and then your embed code should look like this: {description, now you want to close this parameter name so the bot knows what content you are providing for this parameter.

To close this parameter, you simply just insert a : which will tell the bot what parameter is being used. After closing it, you'll now finally provide the raw string that is essentially just regular message text. Now, the parameter, in the embed code, should look like this:{description: hello something random here

Finally, you're going to want to close your parameter with a right curly bracket }.

Multiple parameters in embed code

Having multiple parameters in embed code is essential and everyone does this. To properly format your next parameter, you are going to simply insert $v after your previous parameter. After inserting the separator, you'll just insert your next parameter just like how you did with the first parameter.

{description: hello something random here}$v{title: the title}

Variables inside parameters

To use and understand variables, it's important that you know that these variables can only be used in parameters that only accept a raw string. They only make sense in raw strings and not hex codes, etc...

Variables are automatically generated content for you depending on the context of a Discord user's current guild, channel and user data. Structure of variables is similar to parameters except that you don't need to pass any type of content, so inserting a :, like you would in a parameter, is not accepted - this is because variables output information for you already.

In the image above, you can see that {guild.name} is inputted and when the embed code is executed, the result of that variable being used outputs the context's guild name. Variables are straight forward and are very easy to use. If you're interested in using variables, click the link below to view every variable.

How can I add a new line to my description parameter?

It's very simple, and no, you don't need to add \n or any of that stuff. All you do is enter SHIFT+ENTER/ go to the next line in your message box on Discord. Fair warning though, your embed code will look ugly.

pageVariables

Why isn't my embed code working for some commands?

Some commands allow raw text and embed code and because of this, the bot needs to know what kind of content that you are trying to provide. To do this, you'll need to begin your embed code with {embed}$v then proceed to write your embed code after as normally.

You can view the list of commands at the bottom of this page to see what commands support embed code and what commands require you specify what kind of content you are providing.

You can always use copyembed to see examples of other embed code

Commands that require/support embed code

If you see a (!) at the end of one of the commands below, it means that the command takes two types of content because raw text and embed code are both supported - so you need to specify what you are talking about.

  • createembed

  • editembed

  • lastfm mode (!)

  • welcome add (!)

  • goodbye add (!)

  • boosts add (!)

  • settings autonick

  • levels message (!)

  • pagination add

  • pagination update

Last updated