# Tutorial & Examples

### 1. Setup your Discord webhooks

Firstly, you need to setup your Discord webhooks. Tutorial can be found here: <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>

{% hint style="info" %}
You will need webhook URL in format: <https://discord.com/api/webhooks/XXX/YYY>
{% endhint %}

### 2. Install the plugin

You can check the [Installation page](/discordsender/setup/installation.md), where everything is described.

### 3. Prepare your pre-defined embeds

Look at [config.yml](/discordsender/setup/config.yml.md) page. You can preview your embedes here: <https://autocode.com/tools/discord/embed-builder/>.

**Example**: I defined `full_example` message. It is used for Event announcements. Here is the result after sending this command: `/dsend send full_example apik007 PvP#Spleef 15#minutes`\
\
In `config.yml` looks like this:

![/dsend send full\_example apik007 PvP#Spleef 15#minutes](/files/EhJ8sHAT77XT36FEOj9L)

```yaml
full_example:
    # If you remove this line or set it to 'NONE', default webhook will be used.
    webhookName: "global_chat"
    # Color of the embed (RGB)
    color:
      red: 20
      green: 200
      blue: 20
    # Description of the embed
    description: "Event was announced! It is held by **%arg_1%**!"
    # URL to image under the embed
    imageUrl: "NONE"
    # URL to small image displayed inside the embed
    thumbnailUrl: "https://minotar.net/avatar/%arg_1%/100.png"
    # Set properties of author. You can remove this section if you don't want to display author.
    author:
      text: "*Held by: %arg_1%*"
      iconUrl: "NONE"
      url: "NONE"
    # Set the title. You can remove 'url' line, or set it to NONE if you want.
    title:
      text: "Event starting soon!"
      url: "https://google.com"
    # Self explaining.
    footer:
      text: "Be careful and join as soon as you can!"
      iconUrl: "NONE"
    # List of fields. You can add as many as you want.
    # If you don't want to use fields, remove this section completely.
    fields:
      my_field:
        # Shall the field be inline?
        inline: false
        title: "Event Type:"
        text: "%arg_2%"
      my_field_2:
        inline: false
        title: "It will start:"
        text: "in %arg_3%"
```

### 4. Grant permission OR implement commands into other plugins!

This plugin is great with combination of other plugins! Do you want to announce the winner in crates? Just add one command to the rewards section.

Do you want eventers to be able to announce Events in advance? Just grant them with permissions: `discordsender.use` and `discordsender.use.<message_name>`

### 5. DONE!


---

# 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://foresttech.gitbook.io/discordsender/usage/tutorial-and-examples.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.
