# 类: BotOfflineEvent

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

**继承自:** [BotEvent](/api/botevent.md)

RainyBot的机器人账号离线事件类，其实例记录了一次机器人账号离线事件的相关数据

## 枚举

enum **ReasonType**

机器人账号的离线原因类型的枚举

* **ACTIVE** = 0\
  机器人账号主动离线
* **FORCE** = 1\
  机器人账号被挤下线(如其他客户端登录等情况)
* **DROPPED** = 2\
  机器人账号意外掉线(网络原因或服务器原因等)

***

## 方法

* static [BotOfflineEvent](/api/botofflineevent.md) **init\_meta (** [Dictionary](https://docs.godotengine.org/en/latest/classes/class_dictionary.html) dic, [int](https://docs.godotengine.org/en/latest/classes/class_int.html) reason\_type **)**

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

***

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

获取机器人离线事件的原因类型，可用类型请参见此类的ReasonType枚举

***

* [bool](https://docs.godotengine.org/en/latest/classes/class_bool.html) **is\_reason\_type (** [int](https://docs.godotengine.org/en/latest/classes/class_int.html) reason **)**

判定机器人离线事件是否是指定类型的原因，可用类型请参见此类的ReasonType枚举

***


---

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