Skip to content

Commit 9980515

Browse files
committed
feat: add message button feature
1 parent 42f21f4 commit 9980515

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

src/types/openapi/v1/message.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,52 @@ export interface MessageToCreate {
101101
ark?: Ark;
102102
message_reference?: MessageReference;
103103
image?: string;
104-
msg_id?: string; // 要回复的消息id,不为空则认为是被动消息
104+
msg_id?: string; // 要回复的消息id,不为空则认为是被动消息,公域机器人会异步审核,不为空是被动消息,公域机器人会校验语料
105+
keyboard?: MessageKeyboard;
106+
}
107+
108+
// MessageKeyboard 消息按钮组件
109+
export interface MessageKeyboard {
110+
id?: string;
111+
content?: CustomKeyboard;
112+
}
113+
114+
// CustomKeyboard 自定义 Keyboard
115+
export interface CustomKeyboard {
116+
rows?: Row[];
117+
}
118+
119+
// Row 每行结构
120+
export interface Row {
121+
buttons?: Button[];
122+
}
123+
124+
// Button 单个按纽
125+
export interface Button {
126+
id?: string; // 按钮 ID
127+
render_data?: RenderData; // 渲染展示字段
128+
action?: Action; // 该按纽操作相关字段
129+
}
130+
131+
// RenderData 按纽渲染展示
132+
export interface RenderData {
133+
label?: string; // 按纽上的文字
134+
visited_label?: string; // 点击后按纽上文字
135+
style?: number; // 按钮样式,0:灰色线框,1:蓝色线框
136+
}
137+
138+
// Action 按纽点击操作
139+
export interface Action {
140+
type?: number; // 操作类型
141+
permission?: Permission; // 可操作
142+
click_limit?: number; // 可点击的次数, 默认不限
143+
data?: string; // 操作相关数据
144+
at_bot_show_channel_list?: boolean; // false:当前 true:弹出展示子频道选择器
145+
}
146+
147+
// Permission 按纽操作权限
148+
export interface Permission {
149+
type?: number; // PermissionType 按钮的权限类型
150+
specify_role_ids?: string[]; // SpecifyRoleIDs 身份组
151+
specify_user_ids?: string[]; // SpecifyUserIDs 指定 UserID
105152
}

0 commit comments

Comments
 (0)