# 类: NudgeEvent

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

**继承自:** [ActionEvent](/api/actionevent.md)

RainyBot的戳一戳事件类，记录了聊天中的一个戳一戳事件的相关数据

## 枚举

enum **SubjectType**

戳一戳事件发生的上下文位置类型，可以是好友聊天或群聊

* **FRIEND** = 0\
  事件发生在好友聊天中
* **GROUP** = 1\
  事件发生在群组聊天中

***

## 方法

* static [NudgeEvent](/api/nudgeevent.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) **get\_sender\_id ( )**

获取戳一戳事件的发送者ID

***

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

获取戳一戳事件发生的上下文ID，例如在群聊中时应为群号

***

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

获取戳一戳事件的接收者(目标)的ID

***

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

获取戳一戳事件发生的上下文位置类型，可用类型请参见上方的SubjectType枚举

***

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

用于判断戳一戳事件是否发生在指定的上下文位置类型

***

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

获取戳一戳事件的动作文本

***

* [String](https://docs.godotengine.org/en/latest/classes/class_string.html) **get\_suffix\_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/nudgeevent.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.
