mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b44e1618fb | ||
![]() |
1e13483bc3 | ||
![]() |
f9519d3923 | ||
![]() |
86cdfbb79b | ||
![]() |
a70585e854 | ||
![]() |
040d0a8635 |
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "4.2.7",
|
||||
"version": "4.2.8",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "4.2.7",
|
||||
"version": "4.2.8",
|
||||
"scripts": {
|
||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||
|
@@ -69,7 +69,7 @@ export class RequestUtil {
|
||||
// 'Content-Length': Buffer.byteLength(postData),
|
||||
// },
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = protocol.request(options, (res: any) => {
|
||||
const req = protocol.request(options, (res: http.IncomingMessage) => {
|
||||
let responseBody = '';
|
||||
res.on('data', (chunk: string | Buffer) => {
|
||||
responseBody += chunk.toString();
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '4.2.7';
|
||||
export const napCatVersion = '4.2.8';
|
||||
|
@@ -163,7 +163,7 @@ export interface NodeIKernelGroupService {
|
||||
|
||||
getGroupPortrait(): void;
|
||||
|
||||
modifyGroupName(groupCode: string, groupName: string, arg: false): void;
|
||||
modifyGroupName(groupCode: string, groupName: string, isNormalMember: boolean): Promise<GeneralCallResult>;
|
||||
|
||||
modifyGroupRemark(groupCode: string, remark: string): void;
|
||||
|
||||
|
@@ -17,7 +17,10 @@ export default class SetGroupName extends OneBotAction<Payload, null> {
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload): Promise<null> {
|
||||
await this.core.apis.GroupApi.setGroupName(payload.group_id.toString(), payload.group_name);
|
||||
let ret = await this.core.apis.GroupApi.setGroupName(payload.group_id.toString(), payload.group_name);
|
||||
if (ret.result !== 0) {
|
||||
throw new Error(`设置群名称失败 ErrCode: ${ret.result} ErrMsg: ${ret.errMsg}`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { OneBotFriendApi } from '@/onebot/api/friend';
|
||||
import { OneBotUserApi } from '@/onebot/api/user';
|
||||
import { OneBotGroupApi } from '@/onebot/api/group';
|
||||
import { OneBotMsgApi } from '@/onebot/api/msg';
|
||||
import { OneBotQuickActionApi } from '@/onebot/api/quick-action';
|
||||
import type { OneBotFriendApi } from '@/onebot/api/friend';
|
||||
import type { OneBotUserApi } from '@/onebot/api/user';
|
||||
import type { OneBotGroupApi } from '@/onebot/api/group';
|
||||
import type { OneBotMsgApi } from '@/onebot/api/msg';
|
||||
import type { OneBotQuickActionApi } from '@/onebot/api/quick-action';
|
||||
|
||||
export * from './friend';
|
||||
export * from './group';
|
||||
|
@@ -118,7 +118,6 @@ export class OneBotMsgApi {
|
||||
return {
|
||||
type: OB11MessageDataType.image,
|
||||
data: {
|
||||
pic_type: element.picType,
|
||||
summary: element.summary,
|
||||
file: encodedFileId,
|
||||
sub_type: element.picSubType,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import type {
|
||||
NapCatOneBot11Adapter,
|
||||
OB11Message,
|
||||
OB11MessageAt,
|
||||
@@ -10,17 +10,19 @@ import {
|
||||
QuickActionGroupMessage,
|
||||
QuickActionGroupRequest,
|
||||
} from '@/onebot';
|
||||
import { NTGroupRequestOperateTypes, NapCatCore, Peer } from '@/core';
|
||||
import { OB11FriendRequestEvent } from '@/onebot/event/request/OB11FriendRequest';
|
||||
import { OB11GroupRequestEvent } from '@/onebot/event/request/OB11GroupRequest';
|
||||
import { NTGroupRequestOperateTypes, type NapCatCore, type Peer } from '@/core';
|
||||
import type { OB11FriendRequestEvent } from '@/onebot/event/request/OB11FriendRequest';
|
||||
import type { OB11GroupRequestEvent } from '@/onebot/event/request/OB11GroupRequest';
|
||||
|
||||
import { ContextMode, createContext, normalize } from '@/onebot/action/msg/SendMsg';
|
||||
import { isNull } from '@/common/helper';
|
||||
|
||||
export class OneBotQuickActionApi {
|
||||
constructor(
|
||||
public obContext: NapCatOneBot11Adapter,
|
||||
public core: NapCatCore,
|
||||
) {
|
||||
private obContext: NapCatOneBot11Adapter;
|
||||
private core: NapCatCore;
|
||||
constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
this.obContext = obContext;
|
||||
this.core = core;
|
||||
}
|
||||
|
||||
async handleQuickOperation(eventContext: QuickActionEvent, quickAction: QuickAction) {
|
||||
|
@@ -58,7 +58,7 @@ export class NapCatOneBot11Adapter {
|
||||
readonly context: InstanceContext;
|
||||
|
||||
configLoader: OB11ConfigLoader;
|
||||
apis: StableOneBotApiWrapper;
|
||||
public readonly apis: StableOneBotApiWrapper;
|
||||
networkManager: OB11NetworkManager;
|
||||
actions: ActionMap;
|
||||
private readonly bootTime = Date.now() / 1000;
|
||||
@@ -76,7 +76,7 @@ export class NapCatOneBot11Adapter {
|
||||
FriendApi: new OneBotFriendApi(this, core),
|
||||
MsgApi: new OneBotMsgApi(this, core),
|
||||
QuickActionApi: new OneBotQuickActionApi(this, core),
|
||||
};
|
||||
} as const;
|
||||
this.actions = createActionMap(this, core);
|
||||
this.networkManager = new OB11NetworkManager();
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
|
||||
try {
|
||||
this.obContext.apis.QuickActionApi
|
||||
.handleQuickOperation(event as QuickActionEvent, resJson)
|
||||
.catch(e=>this.logger.logError(e));
|
||||
.catch(e => this.logger.logError(e));
|
||||
} catch (e: any) {
|
||||
this.logger.logError('[OneBot] [Http Client] 新消息事件HTTP上报返回快速操作失败', e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user