# Embeds

***

{% hint style="info" %}
Check the [Discord Wiki](https://discord.com/developers/docs/resources/message#embed-object) for more information on how to format an embed message using the [json format](https://www.w3schools.com/js/js_json_syntax.asp).
{% endhint %}

## Global Internal Placeholders

A list of internal placeholders that are available for all embeds.

| Placeholder        | Description                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| %store%            | This will return your store url defined in the [messages.yml](/wiki/storedata/messages.md) under `store`.                         |
| %default-username% | This will return your default username defined in the [messages.yml](/wiki/storedata/messages.md) under `embed-default-username`. |
| %default-avatar%   | This will return your default avatar url defined in the [messages.yml](/wiki/storedata/messages.md) under `embed-default-avatar`. |

## Embed Files

{% tabs %}
{% tab title="purchase.json" %}
{% code title="CrownStoreData/embeds/purchase.json
" overflow="wrap" lineNumbers="true" expandable="true" %}

````json
{
  "username": "%default-username%",
  "avatar_url": "%default-avatar%",
  "embeds": [
    {
      "title": "Thank You for your support!",
      "description": "```%player% has spent $%amount% in our store!```",
      "color": "42f584",
      "thumbnail": {
        "url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "author": {
        "name": "Visit our Store now!",
        "url": "%store%",
        "icon_url": "https://minotar.net/cube/%playername%/100.png"
      },
      "fields": [
        {
          "name": "Packages",
          "value": "```diff\n+ %package%\n```",
          "inline": false
        }
      ],
      "image": {
        "url": "%image%"
      },
      "footer": {
        "text": "Monthly Goal: %ctd_goal_reached_percentage_46545%% / 100%  %ctd_goal_dcbars_46545%",
        "icon_url": "https://minotar.net/cube/%playername%/100.png"
      }
    }
  ]
}
````

{% endcode %}

### Internal Placeholders&#x20;

A list of internal placeholders available for the purchase embed.

| Placeholder                       | Description                                                                                                                                                                                                                                                                                                         |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| %image% with image mode `RANDOM`. | This will return a random url choosen from the list found in [messages.yml](/wiki/storedata/messages.md) defined under `embed-purchase-images`.                                                                                                                                                                     |
| %image% with image mode `MAPPED`. | <p>This will return a the mapped url for the package configured in the <a href="/pages/dhgUUnfjgJeCw1h0hw04">config.yml</a> under <code>webhook.purchase-images.map</code>.<br><br>If no mapped url is found, it will return the default url configured under <code>webhook.purchase-images.default-url</code>.</p> |
| %player%                          | The player name read from the payment data.                                                                                                                                                                                                                                                                         |
| %playername%                      | The player name read from our internal data.                                                                                                                                                                                                                                                                        |
| %amount%                          | The purchase value.                                                                                                                                                                                                                                                                                                 |
| %package%                         | <p>The first package formatted like this:<br><code>x \<quantity> \<name></code></p>                                                                                                                                                                                                                                 |
| %packages%                        | All packages. Format is defined in [messages.yml](/wiki/storedata/messages.md) under `embed-packages-placeholder-format`.                                                                                                                                                                                           |

{% endtab %}

{% tab title="goal-reached.json" %}

<pre class="language-json" data-title="CrownStoreData/embeds/goal-reached.json
" data-overflow="wrap" data-line-numbers data-expandable="true"><code class="lang-json">{
  "username": "%default-username%",
  "avatar_url": "%default-avatar%",
  "embeds": [
    {
      "title": "The %goal% was completed ($%target%)",
      "description": "```We have successfully completed the %goal% for the %times_achieved% time!```",
      "color": "b64fff",
      "author": {
        "name": "%store%",
        "url": "https://dsc.gg/crowndevelopment",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "thumbnail": {
        "url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
<strong>      "fields": [
</strong>        {
          "name": "Reward",
          "value": "```\n* Thank you from Obey\n\n```",
          "inline": false
        }
      ],
      "footer": {
        "text": "Monthly Goal: 100%  🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      }
    }
  ]
}
</code></pre>

### Internal Placeholders&#x20;

A list of internal placeholders available for the goal embed.

| Placeholder       | Description                                 |
| ----------------- | ------------------------------------------- |
| %goal%            | Thhe goal name.                             |
| %target%          | The goals target amount.                    |
| %times\_achieved% | The amount of times the goal was completed. |
| %current\_amount% | The current goal amount.                    |
| %percentage%      | The current goal percentage.                |
| {% endtab %}      |                                             |

{% tab title="milestone-reached.json" %}
{% code title="CrownStoreData/embeds/minestone-reached.json
" overflow="wrap" lineNumbers="true" expandable="true" %}

````json
{
  "username": "%default-username%",
  "avatar_url": "%default-avatar%",
  "embeds": [
    {
      "title": "🎉 Milestone reached: %milestone%",
      "description": "```We have reached %milestone%% on the %goal%!```",
      "color": "ffa742",
      "author": {
        "name": "%store%",
        "url": "https://dsc.gg/crowndevelopment",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "thumbnail": {
        "url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "footer": {
        "text": "Monthly Goal: %ctd_goal_reached_percentage_46545%% / 100%  %ctd_goal_dcbars_46545%",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      }
    }
  ]
}
````

{% endcode %}

### Internal Placeholders&#x20;

A list of internal placeholders available for the milestone embed.

<table data-header-hidden="false" data-header-sticky><thead><tr><th>Placeholder</th><th>Description</th></tr></thead><tbody><tr><td>%milestone%</td><td>The milestone amount.</td></tr></tbody></table>
{% endtab %}

{% tab title="sale.json" %}
{% code title="CrownStoreData/embeds/sale.json
" overflow="wrap" lineNumbers="true" expandable="true" %}

````json
{
  "username": "%default-username%",
  "avatar_url": "%default-avatar%",
  "embeds": [
    {
      "title": "Activated %sale% Sale!",
      "description": "> Visit our [Store](%store%) now! :tada:",
      "color": "ff87e1",
      "author": {
        "name": "%store%",
        "url": "https://dsc.gg/crowndevelopment",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "thumbnail": {
        "url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      },
      "fields": [
        {
          "name": "Information",
          "value": "```diff\n+ Visit our Store now!\n\n```",
          "inline": false
        }
      ],
      "footer": {
        "text": "%store%",
        "icon_url": "https://github.com/Obeeyyyy/images/blob/17592eae531341d0066ab87ac3d31d8eee6abcb4/crown.png"
      }
    }
  ]
}
````

{% endcode %}

### Internal Placeholders&#x20;

A list of internal placeholders available for the sale embed.

<table data-header-hidden="false" data-header-sticky><thead><tr><th>Placeholder</th><th>Description</th></tr></thead><tbody><tr><td>%sale%</td><td>The sale name.</td></tr><tr><td>%type%</td><td>The sale discount type.</td></tr><tr><td>%expires%</td><td>Date for sale expiration.</td></tr><tr><td>%started%</td><td>Date for sale start.</td></tr><tr><td>%amount%</td><td>Either the discount percentage or discount value.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://obey.gitbook.io/wiki/storedata/purchase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
