public class InterAction extends Object implements SenderV2, SenderAndCidMidGetter
| 属性 | 类型 | 说明 |
|---|---|---|
| id | string | 平台方事件 ID,可以用于被动消息发送 |
| type | int | 消息按钮: 11,单聊快捷菜单:12 |
| scene | string | 事件发生的场景:c2c、group、guild |
| chat_type | int | 0 频道场景,1 群聊场景,2 单聊场景 |
| timestamp | string | 触发时间 RFC 3339 格式 |
| guild_id | string | 频道的 openid ,仅在频道场景提供该字段 |
| channel_id | string | 文字子频道的 openid,仅在频道场景提供该字段 |
| user_openid | string | 单聊单聊按钮触发x,的用户 openid,仅在单聊场景提供该字段 |
| group_openid | string | 群的 openid,仅在群聊场景提供该字段 |
| group_member_openid | string | 按钮触发用户,群聊的群成员 openid,仅在群聊场景提供该字段 |
| data.resoloved.button_data | string | 操作按钮的 data 字段值(在发送消息按钮时设置) |
| data.resoloved.button_id | string | 操作按钮的 id 字段值(在发送消息按钮时设置) |
| data.resoloved.user_id | string | 操作的用户 userid,仅频道场景提供该字段 |
| data.resoloved.feature_id | string | 操作按钮的 id 字段值,仅自定义菜单提供该字段(在管理端设置) |
| data.resoloved.message_id | string | 操作的消息id,目前仅频道场景提供该字段 |
| version | int | 默认 1 |
| application_id | string | 机器人的 appid |
| Modifier and Type | Class and Description |
|---|---|
static class |
InterAction.DataR |
static class |
InterAction.Resolved |
| Constructor and Description |
|---|
InterAction() |
| Modifier and Type | Method and Description |
|---|---|
String |
getCid()
获取 channel id
|
EnvType |
getEnvType()
获得发送环境
guild/qq
|
String |
getMid()
获取 message id
|
BaseV2 |
getV2() |
Result |
send(MessagePacket packet)
以自定义方式发送消息
|
Result |
send(SendAble msg)
以各种方式 达到想要发送的效果
|
Result |
send(String text)
以JSON方式发送文本消息
|
Result |
send(String text,
RawMessage message)
以JSON方式发送文本消息并引用指定消息
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBot, setBotpublic String getCid()
SenderAndCidMidGettergetCid in interface SenderAndCidMidGetterpublic String getMid()
SenderAndCidMidGettergetMid in interface SenderAndCidMidGetterpublic EnvType getEnvType()
SenderAndCidMidGettergetEnvType in interface SenderAndCidMidGetterpublic Result send(String text, RawMessage message)
Senderpublic Result send(MessagePacket packet)
SenderCopyright © 2024. All rights reserved.