feat: new napcat-4.9.0-beta
This commit is contained in:
1 parent
f9c9b3a852
commit
6778bd69de
16 files changed
+72
-115
No files matched your search
@@ -64,7 +64,7 @@ export class NTQQFileApi {
|
||||
}
|
||||
}
|
||||
|
||||
async getFileUrl(chatType: ChatType, peer: string, fileUUID?: string, file10MMd5?: string | undefined,timeout: number = 20000) {
|
||||
async getFileUrl(chatType: ChatType, peer: string, fileUUID?: string, file10MMd5?: string | undefined,timeout: number = 5000) {
|
||||
if (this.core.apis.PacketApi.packetStatus) {
|
||||
try {
|
||||
if (chatType === ChatType.KCHATTYPEGROUP && fileUUID) {
|
||||
@@ -79,7 +79,7 @@ export class NTQQFileApi {
|
||||
throw new Error('fileUUID or file10MMd5 is undefined');
|
||||
}
|
||||
|
||||
async getPttUrl(peer: string, fileUUID?: string,timeout: number = 20000) {
|
||||
async getPttUrl(peer: string, fileUUID?: string,timeout: number = 5000) {
|
||||
if (this.core.apis.PacketApi.packetStatus && fileUUID) {
|
||||
let appid = new NapProtoMsg(FileId).decode(Buffer.from(fileUUID.replaceAll('-', '+').replaceAll('_', '/'), 'base64')).appid;
|
||||
try {
|
||||
@@ -107,7 +107,7 @@ export class NTQQFileApi {
|
||||
throw new Error('packet cant get ptt url');
|
||||
}
|
||||
|
||||
async getVideoUrlPacket(peer: string, fileUUID?: string,timeout: number = 20000) {
|
||||
async getVideoUrlPacket(peer: string, fileUUID?: string,timeout: number = 5000) {
|
||||
if (this.core.apis.PacketApi.packetStatus && fileUUID) {
|
||||
let appid = new NapProtoMsg(FileId).decode(Buffer.from(fileUUID.replaceAll('-', '+').replaceAll('_', '/'), 'base64')).appid;
|
||||
try {
|
||||
|
||||
@@ -13,12 +13,11 @@ import {
|
||||
Peer,
|
||||
ChatType,
|
||||
} from '@/core';
|
||||
import { isNumeric, sleep, solveAsyncProblem } from '@/common/helper';
|
||||
import { isNumeric, solveAsyncProblem } from '@/common/helper';
|
||||
import { LimitedHashTable } from '@/common/message-unique';
|
||||
import { NTEventWrapper } from '@/common/event';
|
||||
import { CancelableTask, TaskExecutor } from '@/common/cancel-task';
|
||||
import { createGroupDetailInfoV2Param, createGroupExtFilter, createGroupExtInfo } from '../data';
|
||||
import { dlopen } from 'node:process';
|
||||
|
||||
export class NTQQGroupApi {
|
||||
context: InstanceContext;
|
||||
@@ -49,12 +48,7 @@ export class NTQQGroupApi {
|
||||
|
||||
async initApi() {
|
||||
this.initCache().then().catch(e => this.context.logger.logError(e));
|
||||
let napcatNativeModule = { exports: {} };
|
||||
dlopen(napcatNativeModule, "E:\\NewDevelop\\Napi2Native\\build\\Release\\napi2native.node");
|
||||
console.log(await this.context.session.getMsgService().sendSsoCmdReqByContend('OidbSvcTrpcTcp.0xed3_1', '0aed030100000000000000000000000000000000000000000000000000000000'));
|
||||
console.log(await this.context.session.getMsgService().sendSsoCmdReqByContend('OidbSvcTrpcTcp.0xed3_1', Buffer.from('0aed030100000000000000000000000000000000000000000000000000000000', 'hex')));
|
||||
}
|
||||
|
||||
async createGrayTip(groupCode: string, tip: string) {
|
||||
return this.context.session.getMsgService().addLocalJsonGrayTipMsg(
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as os from 'os';
|
||||
import offset from '@/core/external/offset.json';
|
||||
import offset from '@/core/external/napi2native.json';
|
||||
import { InstanceContext, NapCatCore } from '@/core';
|
||||
import { LogWrapper } from '@/common/log';
|
||||
import { PacketClientSession } from '@/core/packet/clientSession';
|
||||
|
||||
Reference in new issue
Block a user