Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
linyuchen committed Apr 28, 2024
2 parents c46a4c7 + 0bded73 commit 9dbc13d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
25 changes: 13 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
1. 修复图片URL,支持Win/Linux X64获取rkey, arm64暂不支持
2. 支持了设置已读群/私聊消息接口
3. 支持了好友添加上报事件
4. 商城表情上报URL
5. 重构了Core日志与服务调用部分, 日志可在`config/napcat_<QQ号>.json`中配置日志开关和等级
6. 适配最新版Win 9.9.9 23159 提升了兼容性
7. 表情回应api和上报
8. 支持获取Cookies 实现更加稳定 API: /get_cookies
9. 新增wsHost和httpHost配置 CONFIG: New
10. 新增获取官方Bot账号范围 API: /get_robot_uin_range
11. 新增设置自身在线状态 API: /set_online_status
12. 修复视频所需的 ffmpeg 路径不正确导致视频封面和市场获取失败
1. 修复图片URL,支持Win/Linux X64获取Rkey - 新增 Module: Moehoo
2. 支持了设置已读群/私聊消息接口 - 新增 API: /mark_private_msg_as_read /mark_group_msg_as_read
3. 支持了好友添加上报事件 - 新增 Event: AddFriend
4. 重构了商城表情URL拼接 - 重构 API: /
5. 重构了Core日志与服务调用部分 - 重构 SYS: Log
6. 适配最新版Win 9.9.9 23159 提升了兼容性 - 修复 SYS: Listener
7. 表情回应api和上报 - 新增 Event/API
8. 支持获取Cookies 实现更加稳定 - 新增 API: /get_cookies
9. 新增wsHost和httpHost配置 - 新增 CONFIG: New
10. 新增获取官方Bot账号范围 - 新增 API: /get_robot_uin_range
11. 新增设置自身在线状态 - 新增 API: /set_online_status
12. 修复群成员加入时间 上次活跃 活跃等级字段 - 影响 API: /get_group_member_info /get_group_member_list
13. 修复视频所需的 ffmpeg 路径不正确导致视频封面和市场获取失败
28 changes: 28 additions & 0 deletions src/common/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,32 @@ export async function HttpGetWithCookies(url: string): Promise<Map<string, strin
req.end()
})

}
export async function HttpPostCookies(url: string): Promise<Map<string, string>> {
return new Promise((resolve, reject) => {
let result: Map<string, string> = new Map<string, string>();
const req = https.get(url, (res: any) => {
res.on('data', (data: any) => {
});
res.on('end', () => {
try {
const responseCookies = res.headers['set-cookie'];
for (const line of responseCookies) {
const parts = line.split(';');
const [key, value] = parts[0].split('=');
result.set(key, value);
}
} catch (e) {
}
resolve(result);

});
});
req.on('error', (error: any) => {
resolve(result);
// console.log(error)
})
req.end()
})

}
2 changes: 1 addition & 1 deletion src/core
Submodule core updated from bedbd4 to f29a5a
1 change: 1 addition & 0 deletions src/onebot11/action/group/GetGroupMemberInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ActionName } from '../types';
import { NTQQUserApi } from '@/core/apis/user';
import { log, logDebug } from '@/common/utils/log';
import { isNull } from '../../../common/utils/helper';
import { WebApi } from '@/core/apis/webapi';


export interface PayloadType {
Expand Down
2 changes: 2 additions & 0 deletions src/onebot11/action/group/GetGroupMemberList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { OB11Constructor } from '../../constructor';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { napCatCore } from '@/core';
import { WebApi } from '@/core/apis/webapi';

export interface PayloadType {
group_id: number
Expand All @@ -14,6 +15,7 @@ class GetGroupMemberList extends BaseAction<PayloadType, OB11GroupMember[]> {
actionName = ActionName.GetGroupMemberList;

protected async _handle(payload: PayloadType) {
console.log(await WebApi.getGroupMember(payload.group_id.toString()));
const group = await getGroup(payload.group_id.toString());
if (group) {
return OB11Constructor.groupMembers(group);
Expand Down

0 comments on commit 9dbc13d

Please sign in to comment.