# 类: AtMessage

[(返回目录)](/api.md)

**继承自:** [Message](/api/message.md)

RainyBot的At消息类，通常代表一个对应实例，此类消息仅适用于群聊

## 描述

这是RainyBot的At消息类，通常代表一个对应实例，此类消息仅适用于群聊\
此类实例代表在消息中At了某群组成员，你也可以主动构建此类实例以便进行此操作

## 方法

* static [AtMessage](/api/atmessage.md) **init (** [int](https://docs.godotengine.org/en/latest/classes/class_int.html) target\_id **)**

手动构造一个AtMessage类的实例，以便在消息中At某群组成员

需要传入想要At的群组成员的ID作为参数

***

* static [AtMessage](/api/atmessage.md) **init\_meta (** [Dictionary](https://docs.godotengine.org/en/latest/classes/class_dictionary.html) dic **)**

通过机器人协议后端的元数据字典构造一个AtMessage类的实例，仅当你知道自己在做什么时才使用

***

* [int](https://docs.godotengine.org/en/latest/classes/class_int.html) **get\_target\_id ( )**

获取实例中储存的被At的群组成员的ID

***

* void **set\_target\_id (** [int](https://docs.godotengine.org/en/latest/classes/class_int.html) target\_id **)**

更改实例中储存的想要At的群组成员的ID

***

* [String](https://docs.godotengine.org/en/latest/classes/class_string.html) **get\_display\_text ( )**

获取实例中储存的被At的群组成员的显示信息(如@啦啦啦)

若为手动构造的实例，将始终返回空字符串

***

* [String](https://docs.godotengine.org/en/latest/classes/class_string.html) **get\_as\_text ( )**

将此实例获取为字符串的形式

***


---

# 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://docs.rainybot.dev/api/atmessage.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.
