Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(qq): refine button type #222

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions adapters/qq/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,21 +1274,48 @@ export interface InlineKeyboardRow {
}

export interface Button {
/** 按钮 ID:在一个 keyboard 消息内设置唯一 */
id?: string
render_data: {
/** 按钮上的文字 */
label: string
/** 点击后按钮上的文字 */
visited_label?: string
/** 按钮样式:0 灰色线框,1 蓝色线框 */
style?: number
}
action: {
/**
* 设置 0 跳转按钮:http 或 小程序 客户端识别 scheme,
* 设置 1 回调按钮:回调后台接口, data 传给后台,
* 设置 2 指令按钮:自动在输入框插入 @bot data
*/
type: number
permission: {
/** 0 指定用户可操作,1 仅管理者可操作,2 所有人可操作,3 指定身份组可操作(仅频道可用) */
type: number
specify_role_ids?: string[]
/** 有权限的用户 id 的列表 */
specify_user_ids?: string[]
/** 有权限的身份组 id 的列表(仅频道可用) */
specify_role_ids?: string[]
}
click_limit?: number
/** 操作相关的数据 */
data: string
/** 指令按钮可用,指令是否带引用回复本消息,默认 false。支持版本 8983 */
reply?: boolean
/** 指令按钮可用,点击按钮后直接自动发送 data,默认 false。支持版本 8983 */
enter?: boolean
/**
* 本字段仅在指令按钮下有效设置后后会忽略 action.enter 配置。
* 设置为 1 时 ,点击按钮自动唤起启手Q选图器,其他值暂无效果。
* (仅支持手机端版本 8983+ 的单聊场景,桌面端不支持)
*/
anchor?: number
/** @deprecated */
click_limit?: number
/** @deprecated */
at_bot_show_channel_list?: boolean
/** 客户端不支持本 action 的时候,弹出的 toast 文案 */
unsupport_tips?: string
}
}
Loading