Skip to content

Instantly share code, notes, and snippets.

@mikeshardmind
Last active February 10, 2022 18:21
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeshardmind/0e15779370d7761a8608ce94936721ed to your computer and use it in GitHub Desktop.
Save mikeshardmind/0e15779370d7761a8608ce94936721ed to your computer and use it in GitHub Desktop.
embedmaker

Advanced Usage

Using yaml syntax, you can create very expressive embeds.

The below is an example which uses every available option in some capacity.

This is also provided as an actual yaml file which you can use with [p]embed uploadnostore to test and tweak

description: |
  This is a multi-line embed description
  Note, the `|` after description, and the indentation.
  Each new line is preserved in the result
  Some of the fields below have special handling for ease of use which do not directly
  Correspond to the JSON payload sent to discord.
  Notable examples of this include
  * fields (where fields are a numbered dict instead of an array to keep the resulting yaml pretty)
  * timestamp (where timestamps are parsed to be more human)
  * color (where hex color support is added with 0xff0000 , even though discord transmits the decimal)
  Emoji such as :one: work properly if sent in discord and the bot can use the emoji
 
  As the emoji names you use like that are a niceness added to discord's interface, not actually how the message is sent,
  For custom emoji, if using the in discord method you can just add the emoji to the text,
  but when uploading, you'd need the code. you can get this by inserting a backslash in front of an emoji
  it should look something like 
  <:whip:355915004366815236>
  or
  <a:magic:487039012197105675>
color: 0xff0000
author:
  name: This is an embedmaker tutorial
  icon_url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
  url: https://github.com/mikeshardmind/SinbadCogs
timestamp: February 18 2019 at 1PM EST
image:
  url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
thumbnail:
  url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
footer:
  text: footer text can go here
  icon_url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
fields:
  1:
    name: The first field
    value: This goes in the field
    inline: True
  2:
    name: The second field
    value: The default for inline is true, providing that isn't actually needed.
  3:
    name: The third field
    value: Any place discord supports things like markdown syntax, go for it [here's a link](https://github.com/mikeshardmind/SinbadCogs)
    inline: False
description: |
This is a multi-line embed description
Note, the `|` after description, and the indentation.
Each new line is preserved in the result
Some of the fields below have special handling for ease of use which do not directly
Correspond to the JSON payload sent to discord.
Notable examples of this include
* fields (where fields are a numbered dict instead of an array to keep the resulting yaml pretty)
* timestamp (where timestamps are parsed to be more human)
* color (where hex color support is added with 0xff0000 , even though discord transmits the decimal)
Emoji such as :one: work properly if sent in discord and the bot can use the emoji
As the emoji names you use like that are a niceness added to discord's interface, not actually how the message is sent,
For custom emoji, if using the in discord method you can just add the emoji to the text,
but when uploading, you'd need the code. you can get this by inserting a backslash in front of an emoji
it should look something like
<:whip:355915004366815236>
or
<a:magic:487039012197105675>
color: 0xff0000
author:
name: This is an embedmaker tutorial
icon_url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
url: https://github.com/mikeshardmind/SinbadCogs
timestamp: February 18 2019 at 1PM EST
image:
url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
thumbnail:
url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
footer:
text: footer text can go here
icon_url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Questionmark.svg/200px-Questionmark.svg.png
fields:
1:
name: The first field
value: This goes in the field
inline: True
2:
name: The second field
value: The default for inline is true, providing that isn't actually needed.
3:
name: The third field
value: Any place discord supports things like markdown syntax, go for it [here's a link](https://github.com/mikeshardmind/SinbadCogs)
inline: False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment