> For the complete documentation index, see [llms.txt](https://emibergo.gitbook.io/redischat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emibergo.gitbook.io/redischat/features/discord-hook.md).

# Discord hook

## Webhooks

Webhooks are a simple way to send messages to a Discord channel. However, remember that communication only takes place in the direction Minecraft -> discord with this method

You can create a webhook for a channel with the command&#x20;

`/channel link-discord-webook <channelName>`**`<webhook link>`**

The webhook link can be obtained in: Discord channel settings -> Integrations -> Create webhook

For public and staffchat webhooks you can configure them

{% code title="config.yml" %}

```yaml
# The discord webhook of the public chat
publicDiscordWebhook: 'https://discord.com/api/webhooks/1223270324200669194/yourtoken'
# The discord webhook of the staff chat
staffChatDiscordWebhook: ''
```

{% endcode %}

***

## Spicord hook

Spicord, unlike webhooks, allows two-way communication between Discord and Minecraft

To enable this feature you need to :

1. Enable Spicord inside RedisChat (enabled: true)

{% code title="config.yml" fullWidth="false" %}

```yaml
# botName is the botId associated to the bot inside the spicord configuration
# Every channel of RedisChat is linked with a channel on Discord
# The first element is a RedisChat channel, the second one is a Discord channel id
# You can find the Discord channel id by right clicking on the channel and clicking on 'Copy ID'
spicord:
  enabled: true
  chatFormat: '<blue>[Discord]</blue>%role% %username% » %message%'
  discordFormat: '**%channel%** %sender% » %message%'
  spicordChannelLink:
    public: '502465727593447434'
```

{% endcode %}

2. Set up the Spicord bot as defined on [the SpigotMC page under Installation and below](https://www.spigotmc.org/resources/spicord.64918/)
3. Add "redischat" as an addon inside the Spicord bot configuration

{% code title="Spicord/config.toml" %}

```toml
[[bots]]
  name = "default"
  enabled = true
  token = "MTE*NjA1Nzc1Mz*DkwNTEzOA.******************************************"
  command_support = true #You need this to true to send messages from Discord to MC
  command_prefix = "-"
  addons = [
    "redischat",
    "otheraddon"
  ]
```

{% endcode %}

4. Link channels to discord channel ids:

{% code title="config.yml" %}

```yaml
  spicordChannelLink:
    public: '502465727593447434' 
 #The ID is obtained by right-clicking on the Discord channel and then Copy channel ID
```

{% endcode %}

5. Invite the bot to your discord server ([Follow this guide](https://github.com/Spicord/Spicord/blob/v5/tutorial/CREATE-A-BOT.md) taken from Spicord)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://emibergo.gitbook.io/redischat/features/discord-hook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
