Created Embeds (markdown)
parent
b788b350be
commit
47ac0a3a89
|
@ -0,0 +1,81 @@
|
|||
# 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
|
||||
```JSON
|
||||
{
|
||||
"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: <br />
|
||||
``footer``,``image``,``provider``,``thumbnail``, etc <br />
|
||||
They are all described in detail [here](https://discord.com/developers/docs/resources/channel#embed-object)
|
||||
|
||||
``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:
|
||||
```JSON
|
||||
{
|
||||
"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
|
||||
```JSON
|
||||
{
|
||||
"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"
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue