Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2025

### 09-09 v0.4.20

- [+] 添加缺少的接口

### 09-02 v0.4.19

- [*] 部分情况下可能收不到 `role` 字段(合并转发中)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

针对 `napcat` 开发的 `SDK`

本 SDK 中所有 `api` 基于 `napcat-v4.8.98`
本 SDK 中所有 `api` 基于 `napcat-v4.8.109`

## 📚 文档

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-napcat-ts",
"version": "0.4.19",
"version": "0.4.20",
"description": "napcat SDK for Node",
"license": "MIT",
"type": "module",
Expand Down
35 changes: 34 additions & 1 deletion src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,9 @@ export type WSSendParam = {
set_group_add_option: {
group_id: string
add_type: number
} & ({} | { group_question: string; group_answer: string })
group_question?: string
group_answer?: string
}
set_group_search: { group_id: string; no_code_finger_open?: number; no_finger_open?: number }
get_doubt_friends_add_request: { count?: number }
set_doubt_friends_add_request: { flag: string }
Expand All @@ -1034,6 +1036,24 @@ export type WSSendParam = {
callback_data?: string
msg_seq?: string
}
set_group_todo: { group_id: string } & ({ message_seq: string } | { message_id: string })
get_qun_album_list: { group_id: string }
upload_image_to_qun_album: {
group_id: string
album_id: string
album_name: string
file: string
}
get_group_album_media_list: { group_id: string; album_id: string; attach_info?: string }
do_group_album_comment: { group_id: string; album_id: string; lloc: string; content: string }
set_group_album_media_like: {
group_id: string
album_id: string
lloc: string
id: string
set?: boolean
}
del_group_album_media: { group_id: string; album_id: string; lloc: string }
}

type Buffer<T = number> = { [key: string]: T }
Expand Down Expand Up @@ -2061,4 +2081,17 @@ export type WSSendReturn = {
promptType: number
promptIcon: number
}
set_group_todo: null
get_qun_album_list: { name: string; album_id: number }[]
upload_image_to_qun_album: null
get_group_album_media_list: {
seq: number
result: number
errMs: string
trace_id: string
request_time_line: unknown
}
do_group_album_comment: null
set_group_album_media_like: null
del_group_album_media: null
}
76 changes: 66 additions & 10 deletions src/NCWebsocketApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ export class NCWebsocket extends NCWebsocketBase {
* @napcat
* 获取最近联系
*/
get_recent_contact(params: WSSendParam['get_recent_contact']) {
return this.send('get_recent_contact', params)
get_recent_contact(params?: WSSendParam['get_recent_contact']) {
return this.send('get_recent_contact', params ?? {})
}

/**
Expand All @@ -798,8 +798,8 @@ export class NCWebsocket extends NCWebsocketBase {
* @napcat
* 获取收藏表情
*/
fetch_custom_face(params: WSSendParam['fetch_custom_face']) {
return this.send('fetch_custom_face', params)
fetch_custom_face(params?: WSSendParam['fetch_custom_face']) {
return this.send('fetch_custom_face', params ?? {})
}

/**
Expand Down Expand Up @@ -1046,8 +1046,8 @@ export class NCWebsocket extends NCWebsocketBase {
* @napcat
* 获取可疑好友添加请求
*/
get_doubt_friends_add_request(params: WSSendParam['get_doubt_friends_add_request']) {
return this.send('get_doubt_friends_add_request', params)
get_doubt_friends_add_request(params?: WSSendParam['get_doubt_friends_add_request']) {
return this.send('get_doubt_friends_add_request', params ?? {})
}

/**
Expand All @@ -1062,16 +1062,16 @@ export class NCWebsocket extends NCWebsocketBase {
* @napcat
* 获取 RKey
*/
get_rkey(params: WSSendParam['get_rkey']) {
return this.send('get_rkey', params)
get_rkey() {
return this.send('get_rkey', {})
}

/**
* @napcat
* 获取 RKey 服务器
*/
get_rkey_server(params: WSSendParam['get_rkey_server']) {
return this.send('get_rkey_server', params)
get_rkey_server() {
return this.send('get_rkey_server', {})
}

/**
Expand All @@ -1097,4 +1097,60 @@ export class NCWebsocket extends NCWebsocketBase {
click_inline_keyboard_button(params: WSSendParam['click_inline_keyboard_button']) {
return this.send('click_inline_keyboard_button', params)
}

/**
* @napcat
* 设置群待办
*/
set_group_todo(params: WSSendParam['set_group_todo']) {
return this.send('set_group_todo', params)
}

/**
* @napcat
* 获取群相册列表
*/
get_qun_album_list(params: WSSendParam['get_qun_album_list']) {
return this.send('get_qun_album_list', params)
}

/**
* @napcat
* 上传图片到群相册
*/
upload_image_to_qun_album(params: WSSendParam['upload_image_to_qun_album']) {
return this.send('upload_image_to_qun_album', params)
}

/**
* @napcat
* 获取群相册媒体列表
*/
get_group_album_media_list(params: WSSendParam['get_group_album_media_list']) {
return this.send('get_group_album_media_list', params)
}

/**
* @napcat
* 评论群相册
*/
do_group_album_comment(params: WSSendParam['do_group_album_comment']) {
return this.send('do_group_album_comment', params)
}

/**
* @napcat
* 点赞群相册媒体
*/
set_group_album_media_like(params: WSSendParam['set_group_album_media_like']) {
return this.send('set_group_album_media_like', params)
}

/**
* @napcat
* 删除群相册媒体
*/
del_group_album_media(params: WSSendParam['del_group_album_media']) {
return this.send('del_group_album_media', params)
}
}