> For the complete documentation index, see [llms.txt](https://docs.gamechat.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamechat.me/basics/game-chat-v3/game-chat-english/start-using-v3/pinned-message.md).

# Pinned message

## Pinned message <a href="#undefined" id="undefined"></a>

In a chat, Pinned Message is a function that pins important messages in a chat room or a group chat to the top of the chat window. This function helps participants see the message easily whenever they open the chat room, and not miss important information or notifications. The following describes the main characteristics of pinned messages and how to use them.

### How to use pinned messages <a href="#undefined" id="undefined"></a>

* **Meeting schedule notice**: sets the schedule of regular meetings or important events as a pinned message to help participants not forget their schedule.
* **Important document links**: pins the links of important documents and materials to allow all participants to access them easily.
* **Rules and guides sharing**: sets the rules of the chat room or project guides as a pinned message to allow new participants to check the guides easily.
* **Urgent notification**: allows sharing the content that needs to be forwarded urgently or any changes with a pinned message.

The pinned messages function is provided in various communication platforms. When you use it effectively, you can enhance the efficiency of team communication.

### Create pinned message <a href="#undefined" id="undefined"></a>

It is a function that pins an important message to the top of the chat application so that users can easily see it. The following C# code shows how to pin messages in the chat channel.

```csharp
var newPin = await nc.createPin(channelId, messageId, pinned, pinnedAt, expiredAt);
```

* `channelId`: the unique identifier of the chat channel where the message will be pinned.
* `pinned`: contents of a message to be pinned.
* `pinnedAt`: displays the time when the message is pinned.
* `expiredAt`: the time when the message will be unpinned.

When you use this function, you can easily highlight important messages in a specific chat channel.

### Edit pinned message <a href="#undefined" id="undefined"></a>

It is a function to update the information of the existing pinned messages. You can change the contents of the message, and the time when the message is pinned and will be unpinned.

```csharp
var updatedPin = await nc.updatePin(id, channelId, pinned, pinnedAt, expiredAt);
```

* `channelId`: ID of the channel where there are messages to be edited.
* `pinned`: the edited message content.
* `pinnedAt`: the time when the message is newly pinned.
* `expiredAt`: the newly set time when the message will be unpinned.

This code is used to change the details of the messages already pinned. It is useful when the importance of the message is changed or the time set for the message to be pinned needs to be changed.

### Pinned message information <a href="#undefined" id="undefined"></a>

It is a function to view the information related to pinning certain messages. You can check the status of the pinned message, and the time when the message is pinned and will be unpinned.

```csharp
var pin = await nc.getPin(channelId, messageId);
```

* `channelId`: ID of the channel from which to retrieve information.
* `messageId`: the unique identifier of the pinned message.

Through this function, you can check the current status of a specific message, which helps the admin or users manage messages in the channel effectively.

### Pinned message list <a href="#undefined" id="undefined"></a>

It is a function that views the list of all messages currently pinned in the chat channel. This function supports paging, so the data can be processed efficiently even in a large-scale channel. Users can set `offset` and `per_page` to bring up the data in the desired range.

```csharp
Hashtable filter = new Hashtable
{
    { "channel_id", channelId },
};
Hashtable sort = new Hashtable
{
    { "created_at", -1 },
};
Hashtable option = new Hashtable
{
    { "offset", 0 },
    { "per_page", 10 },
};
var pins = await nc.getPins(channelId, filter, sort, option);
```

#### **Parameter descriptions**

* **Filter**: defines the conditions for filtering the data to be viewed. For example, you can view pinned messages in a specific channel.
* **Sort**: defines how to sort the results list. Here, sorting in descending (-1) order is used based on the creation time (`created_at`).
* **Option**: defines the options to be used when viewing. `offset` specifies the location where the view starts, and `per_page` specifies the number of messages to be shown per page.

#### **Options details**

<table><thead><tr><th width="118">ID</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>offset</td><td>number</td><td>Start location where the data will be brought up.</td></tr><tr><td>per_page</td><td>number</td><td>The number of messages to be returned per page, and up to 100 messages can be set.</td></tr></tbody></table>

If you use this function, the channel manager can easily monitor and manage important messages in the channel. Also, the channel manager can quickly find and sort pinned messages based on the specific user or time, which helps operate the channel efficiently.


---

# 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://docs.gamechat.me/basics/game-chat-v3/game-chat-english/start-using-v3/pinned-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.
