# 类: BotCodeMessage

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

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

RainyBot的BotCode消息类，通常代表一个对应实例，可用于快捷发送一段包含多种类型的消息

## 描述

这是RainyBot的BotCode消息类，通常代表一个对应实例，可用于快捷发送一段包含多种类型的消息\
此类实例通常不会出现在消息链中，而是用于主动构建此类实例以便快捷发送消息

## 方法

* static [BotCodeMessage](/api/botcodemessage.md) **init (** [String](https://docs.godotengine.org/en/latest/classes/class_string.html) text **)**

基于包含BotCode的文本来构造BotCodeMessage的实例，以便快捷发送复杂消息

***

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

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

***

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

获取实例中储存的BotCode文本

***

* void **set\_code\_text (** [String](https://docs.godotengine.org/en/latest/classes/class_string.html) text **)**

更改实例中储存的BotCode文本

***

* [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/botcodemessage.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.
