# 类: CacheMessage

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

**继承自:** [MessageAPI](/api/messageapi.md)

RainyBot的缓存消息类，通常代表一个对应实例，用于储存从机器人后端缓存中读取的消息的相关信息

## 描述

这是RainyBot的缓存消息类，通常代表一个对应实例，用于储存从机器人后端缓存中读取的消息的相关信息\
此类实例中通常储存了消息对应的消息链，以及消息对应的发送者实例等信息

## 方法

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

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

***

* [Dictionary](https://docs.godotengine.org/en/latest/classes/class_dictionary.html) **get\_metadata ( )**

获取实例中的元数据字典，仅当你知道自己在做什么时才使用

***

* void **set\_metadata (** [Dictionary](https://docs.godotengine.org/en/latest/classes/class_dictionary.html) dic **)**

使用指定字典覆盖实例中的元数据字典，仅当你知道自己在做什么时才使用

***

* [MessageChain](/api/messagechain.md) **get\_message\_chain ( )**

获取缓存消息实例中储存的消息对应的消息链

***

* [RoleAPI](/api/roleapi.md) **get\_sender ( )**

获取缓存消息实例中储存的消息对应的发送者实例

返回的类型不定，可能返回Member,GroupMember或OtherClient类的实例

***


---

# 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/cachemessage.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.
