1 Embeds
Yessiest edited this page 2022-02-21 17:38:03 +00:00

Embed format

Embeds are specific messages that can only be sent by bots. They are usually sent as a JSON objects via the API. This page will describe the format for creating your own embeds

Structure

Embed use the following structure

{
  "title":"This is the title",
  "description":"This is the description",
  "object":{
     "property":"This is the property of our embed object."
  },
  "fields":[
    {
      "name":"This is the name of a new field",
      "value":"This is the text for the field to display",
    }
  ],
  "color": 33228112
} 

title property describes the title for the embed. It is usually placed at the top of the embed.

description property describes the description text. It is placed directly underneath the title.

object is actually an additional construct for the embed. By itself, property object doesn't exist in embeds - in this example it used as a shortcut for the following types of embed additions:
footer,image,provider,thumbnail, etc
They are all described in detail here

color property is a 24bit bit integer, with 8 bits per color value. For ease of use, the embed command of the meta package automatically converts html color values (#000000 - #FFFFFF) to the 24 bit integer.

fields object describes a list of objects with a name and text attached to it. You can see the usage for fields whenever you use the help command - plugin name is in the name of each field and commands added by plugins are in the value of each field.

Examples:

Note: All of the examples below are made compatible with the embed command. You might experience some errors with colors if you attempt to send those as a raw JSON embed object.

Leaderboard:

{
  "title":"Leaderboard",
  "description":"These are the top 5 letters in the English alphabet (according to our non-existent survey):",
  "fields":[
    {
     "name":"T",
     "value":"T is the first letter in the word \"The\", which is the #1 most used word in the English language"
    },
    {
     "name":"B",
     "value":"B is the first letter in the word \"Bot\"."
    },
    {
     "name":"S",
     "value":"S is the first letter in the word \"Super\". It is also sometimes used to describe something greater than the \"A\" grade on the A-D grading system" 
    },
    { 
     "name":"F",
     "value":"F is widely used to describe deepest condolences in some particularly unlucky situations"
    },
    {
     "name":"A",
     "value":"***AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA***"
    }
  ],
  "color":"#6C83CA"
}

Welcome message

{
  "title":"Welcome!",
  "description":"Read the rules at #rules and enjoy your stay",
  "image":{
    "url":"https://cdn.discordapp.com/attachments/731716869576327201/744818377461071952/Welcome-Black-Text-White-BG.gif"
  },
  "color":"#2FC32F"
}