> For the complete documentation index, see [llms.txt](https://documentation.botghost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.botghost.com/custom-commands-and-events/actions/message-actions/publish-a-message.md).

# Publish a Message

<figure><img src="/files/N7CXFzzfP6XkaHJl1GtL" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
This feature is only available in [announcements channels](https://support.discord.com/hc/en-us/articles/360032008192-Announcement-Channels).
{% endhint %}

When triggered, the Publish a Message action crossposts, or publishes, a message across other servers and channels that follow its channel. This message can be set by its channel and message ID. All variables and options can be used in the channel and message ID fields.

<figure><img src="/files/MM5mXhNKHxS1I0kOhdrL" alt=""><figcaption></figcaption></figure>

## Channel ID

Here you can set the ID of the channel the message you're publishing is in. You can do this by pasting an ID directly from Discord (learn how [here](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID)) or using a variable that returns a channel ID. These can be easily added through the variable selector by clicking the **Clipboard** button.

## Message ID

Here you can set the ID of message you're publishing. You can do this by pasting an ID directly from Discord (learn how [here](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID)) or using a variable that returns a message ID. These can be easily added through the variable selector by clicking the **Clipboard** button.

***

Below is an example of a simple command that uses [Send a message to a channel ](/custom-commands-and-events/actions/legacy-reply-actions/send-a-message-to-a-channel.md)and publishes the message.

<figure><img src="/files/PVwfOkqPI2D6HZpu3nBu" alt=""><figcaption></figcaption></figure>


---

# 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://documentation.botghost.com/custom-commands-and-events/actions/message-actions/publish-a-message.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.
