mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b0242ccb62 | ||
![]() |
53f5277b08 | ||
![]() |
90b54435b5 | ||
![]() |
12a1681b42 | ||
![]() |
4277cb3f3c | ||
![]() |
8353d53589 | ||
![]() |
9e94d98cfb | ||
![]() |
b6ec1aaa9b | ||
![]() |
e7e8763f1c | ||
![]() |
515c1af676 | ||
![]() |
6fa7a973ba | ||
![]() |
3e63f509bc | ||
![]() |
b3b02e781a | ||
![]() |
6d83921e20 | ||
![]() |
30bd372d45 | ||
![]() |
63254b7e55 | ||
![]() |
f4c08d93f4 | ||
![]() |
6ca1ac21e4 | ||
![]() |
381ee1c30e |
@@ -45,12 +45,8 @@ NapCatQQ 是现代化的基于 NTQQ 的 Bot 协议端实现
|
||||
|
||||
---
|
||||
|
||||
## 延缓Native模块与NapCat对新版QQ适配
|
||||
为未来持续与高效的使用Native模块 模块代码转为完全非Git仓库的本地保存源码 并进行相关重构
|
||||
|
||||
同时为了保证稳定 NapCat 本体通常会在3 Week+的周期进行新版本适配
|
||||
|
||||
因此此时推荐使用release指定版本
|
||||
## 特殊感谢
|
||||
[LLOneBot](https://github.com/LLOneBot/LLOneBot) 相关的开发曾参与本项目
|
||||
|
||||
## 开源附加
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "4.1.12",
|
||||
"version": "4.1.15",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "4.1.12",
|
||||
"version": "4.1.15",
|
||||
"scripts": {
|
||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||
"build:shell": "npm run build:webui && vite build --mode shell || exit 1",
|
||||
|
@@ -19,14 +19,6 @@ type Uri2LocalRes = {
|
||||
path: string
|
||||
}
|
||||
|
||||
export function isGIF(path: string) {
|
||||
const buffer = Buffer.alloc(4);
|
||||
const fd = fs.openSync(path, 'r');
|
||||
fs.readSync(fd, buffer, 0, 4, 0);
|
||||
fs.closeSync(fd);
|
||||
return buffer.toString() === 'GIF8';
|
||||
}
|
||||
|
||||
// 定义一个异步函数来检查文件是否存在
|
||||
export function checkFileExist(path: string, timeout: number = 3000): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '4.1.12';
|
||||
export const napCatVersion = '4.1.15';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { MsfChangeReasonType, MsfStatusType } from "../types/adapter";
|
||||
import { MsfChangeReasonType, MsfStatusType } from "@/core/types/adapter";
|
||||
|
||||
export class NodeIDependsAdapter {
|
||||
onMSFStatusChange(statusType: MsfStatusType, changeReasonType: MsfChangeReasonType) {
|
||||
|
@@ -20,13 +20,14 @@ import { InstanceContext, NapCatCore, SearchResultItem } from '@/core';
|
||||
import * as fileType from 'file-type';
|
||||
import imageSize from 'image-size';
|
||||
import { ISizeCalculationResult } from 'image-size/dist/types/interface';
|
||||
import { RkeyManager } from '../helper/rkey';
|
||||
import { calculateFileMD5, isGIF } from '@/common/file';
|
||||
import { RkeyManager } from '@/core/helper/rkey';
|
||||
import { calculateFileMD5 } from '@/common/file';
|
||||
import pathLib from 'node:path';
|
||||
import { defaultVideoThumbB64, getVideoInfo } from '@/common/video';
|
||||
import ffmpeg from 'fluent-ffmpeg';
|
||||
import { encodeSilk } from '@/common/audio';
|
||||
import { MessageContext } from '@/onebot/api';
|
||||
import { getFileTypeForSendType } from '../helper/msg';
|
||||
|
||||
export class NTQQFileApi {
|
||||
context: InstanceContext;
|
||||
@@ -130,7 +131,7 @@ export class NTQQFileApi {
|
||||
fileName: fileName,
|
||||
sourcePath: path,
|
||||
original: true,
|
||||
picType: isGIF(picPath) ? PicType.NEWPIC_GIF : PicType.NEWPIC_JPEG,
|
||||
picType: await getFileTypeForSendType(picPath),
|
||||
picSubType: subType,
|
||||
fileUuid: '',
|
||||
fileSubId: '',
|
||||
|
@@ -18,30 +18,19 @@ export class NTQQUserApi {
|
||||
async getStatusByUid(uid: string) {
|
||||
return this.context.session.getProfileService().getStatus(uid);
|
||||
}
|
||||
async getProfileLike(uid: string, start: number, count: number) {
|
||||
// 默认获取自己的 type = 2 获取别人 type = 1
|
||||
async getProfileLike(uid: string, start: number, count: number, type: number = 2) {
|
||||
return this.context.session.getProfileLikeService().getBuddyProfileLike({
|
||||
friendUids: [uid],
|
||||
basic: 1,
|
||||
vote: 1,
|
||||
favorite: 0,
|
||||
userProfile: 1,
|
||||
type: 2,
|
||||
type: type,
|
||||
start: start,
|
||||
limit: count,
|
||||
});
|
||||
}
|
||||
async fetchOtherProfileLike(uid: string) {
|
||||
return this.context.session.getProfileLikeService().getBuddyProfileLike({
|
||||
friendUids: [uid],
|
||||
basic: 1,
|
||||
vote: 1,
|
||||
favorite: 0,
|
||||
userProfile: 0,
|
||||
type: 1,
|
||||
start: 0,
|
||||
limit: 20,
|
||||
});
|
||||
}
|
||||
async setLongNick(longNick: string) {
|
||||
return this.context.session.getProfileService().setLongNick(longNick);
|
||||
}
|
||||
|
12
src/core/external/appid.json
vendored
12
src/core/external/appid.json
vendored
@@ -86,5 +86,17 @@
|
||||
"6.9.59-29456": {
|
||||
"appid": 537249961,
|
||||
"qua": "V1_MAC_NQ_6.9.59_29456_GW_B"
|
||||
},
|
||||
"9.9.16-29927": {
|
||||
"appid": 537255812,
|
||||
"qua": "V1_WIN_NQ_9.9.16_29927_GW_B"
|
||||
},
|
||||
"3.2.13-29927": {
|
||||
"appid": 537255847,
|
||||
"qua": "V1_LNX_NQ_3.2.13_29927_GW_B"
|
||||
},
|
||||
"6.9.61-29927": {
|
||||
"appid": 537255836,
|
||||
"qua": "V1_MAC_NQ_6.9.61_29927_GW_B"
|
||||
}
|
||||
}
|
||||
|
20
src/core/external/offset.json
vendored
20
src/core/external/offset.json
vendored
@@ -82,5 +82,25 @@
|
||||
"6.9.59-29456-arm64": {
|
||||
"send": "4005FE8",
|
||||
"recv": "4008800"
|
||||
},
|
||||
"9.9.16-29927-x64": {
|
||||
"send": "3869C50",
|
||||
"recv": "386E084"
|
||||
},
|
||||
"3.2.13-29927-x64": {
|
||||
"send": "A1913A0",
|
||||
"recv": "A194CA0"
|
||||
},
|
||||
"3.2.13-29927-arm64": {
|
||||
"send": "6F1C7E0",
|
||||
"recv": "6F20018"
|
||||
},
|
||||
"6.9.61-29927-x64": {
|
||||
"send": "44FCC60",
|
||||
"recv": "44FF4CC"
|
||||
},
|
||||
"6.9.61-29927-arm64": {
|
||||
"send": "4038740",
|
||||
"recv": "403AF58"
|
||||
}
|
||||
}
|
||||
|
14
src/core/helper/msg.ts
Normal file
14
src/core/helper/msg.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as fileType from 'file-type';
|
||||
import { PicType } from '../types';
|
||||
export async function getFileTypeForSendType(picPath: string): Promise<PicType> {
|
||||
const fileTypeResult = (await fileType.fileTypeFromFile(picPath))?.ext ?? 'jpg';
|
||||
const picTypeMap: { [key: string]: PicType } = {
|
||||
'webp': PicType.NEWPIC_WEBP,
|
||||
'gif': PicType.NEWPIC_GIF,
|
||||
'png': PicType.NEWPIC_APNG,
|
||||
'jpg': PicType.NEWPIC_JPEG,
|
||||
'jpeg': PicType.NEWPIC_JPEG,
|
||||
'bmp': PicType.NEWPIC_BMP,
|
||||
};
|
||||
return picTypeMap[fileTypeResult] ?? PicType.NEWPIC_JPEG;
|
||||
}
|
@@ -14,6 +14,8 @@ import {
|
||||
GroupFileExtra
|
||||
} from "@/core/packet/transformer/proto";
|
||||
import {
|
||||
BaseEmojiType,
|
||||
FaceType,
|
||||
NTMsgAtType,
|
||||
PicType,
|
||||
SendArkElement,
|
||||
@@ -162,7 +164,7 @@ export class PacketMsgFaceElement extends IPacketMsgElement<SendFaceElement> {
|
||||
constructor(element: SendFaceElement) {
|
||||
super(element);
|
||||
this.faceId = element.faceElement.faceIndex;
|
||||
this.isLargeFace = element.faceElement.faceType === 3;
|
||||
this.isLargeFace = element.faceElement.faceType === FaceType.AniSticke;
|
||||
}
|
||||
|
||||
buildElement(): NapProtoEncodeStructType<typeof Elem>[] {
|
||||
|
17
src/core/services/NodeIKernelBaseEmojiService.ts
Normal file
17
src/core/services/NodeIKernelBaseEmojiService.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { DownloadBaseEmojiByIdReq, DownloadBaseEmojiByUrlReq, GetBaseEmojiPathReq, PullSysEmojisReq } from '../types';
|
||||
|
||||
export interface NodeIKernelBaseEmojiService {
|
||||
removeKernelBaseEmojiListener(listenerId: number): void;
|
||||
|
||||
addKernelBaseEmojiListener(listener: unknown): number;
|
||||
|
||||
isBaseEmojiPathExist(args: Array<string>): unknown;
|
||||
|
||||
fetchFullSysEmojis(pullSysEmojisReq: PullSysEmojisReq): unknown;
|
||||
|
||||
getBaseEmojiPathByIds(getBaseEmojiPathReqs: Array<GetBaseEmojiPathReq>): unknown;
|
||||
|
||||
downloadBaseEmojiByIdWithUrl(downloadBaseEmojiByUrlReq: DownloadBaseEmojiByUrlReq): unknown;
|
||||
|
||||
downloadBaseEmojiById(downloadBaseEmojiByIdReq: DownloadBaseEmojiByIdReq): unknown;
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
import { GeneralCallResult } from '@/core/services/common';
|
||||
import { NodeIKernelBuddyListener } from '@/core/listeners';
|
||||
import { BuddyListReqType } from '../types/user';
|
||||
import { BuddyListReqType } from '@/core/types/user';
|
||||
|
||||
export interface NodeIKernelBuddyService {
|
||||
getBuddyListV2(callFrom: string, reqType: BuddyListReqType): Promise<GeneralCallResult & {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { ElementType, MessageElement, Peer, RawMessage, SendMessageElement } from '@/core/types';
|
||||
import { NodeIKernelMsgListener } from '@/core/listeners/NodeIKernelMsgListener';
|
||||
import { GeneralCallResult } from '@/core/services/common';
|
||||
import { MsgReqType, QueryMsgsParams, TmpChatInfoApi } from '../types/msg';
|
||||
import { MsgReqType, QueryMsgsParams, TmpChatInfoApi } from '@/core/types/msg';
|
||||
|
||||
export interface NodeIKernelMsgService {
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { ChatType, Peer } from '@/core/types';
|
||||
import { NodeIKernelRecentContactListener } from '../listeners/NodeIKernelRecentContactListener';
|
||||
import { GeneralCallResult } from './common';
|
||||
import { FSABRecentContactParams } from '../types/contact';
|
||||
import { NodeIKernelRecentContactListener } from '@/core/listeners/NodeIKernelRecentContactListener';
|
||||
import { GeneralCallResult } from '@/core/services/common';
|
||||
import { FSABRecentContactParams } from '@/core/types/contact';
|
||||
|
||||
export interface NodeIKernelRecentContactService {
|
||||
setGuildDisplayStatus(...args: unknown[]): unknown; // 2 arguments
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { NodeIO3MiscListener } from "../listeners/NodeIO3MiscListener";
|
||||
import { NodeIO3MiscListener } from "@/core/listeners/NodeIO3MiscListener";
|
||||
|
||||
export interface NodeIO3MiscService {
|
||||
get(): NodeIO3MiscService;
|
||||
|
@@ -1,11 +1,11 @@
|
||||
export enum MsfStatusType {
|
||||
KUNKNOWN,
|
||||
KDISCONNECTED,
|
||||
KCONNECTED
|
||||
KUNKNOWN = 0,
|
||||
KDISCONNECTED = 1,
|
||||
KCONNECTED = 2
|
||||
}
|
||||
export enum MsfChangeReasonType {
|
||||
KUNKNOWN,
|
||||
KUSERLOGININ,
|
||||
KUSERLOGINOUT,
|
||||
KAUTO
|
||||
KUNKNOWN = 0,
|
||||
KUSERLOGININ = 1,
|
||||
KUSERLOGINOUT = 2,
|
||||
KAUTO = 3
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
import { ElementType, FaceType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType } from "./msg";
|
||||
import { ElementType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType, FaceType } from "./msg";
|
||||
|
||||
type ElementFullBase = Omit<MessageElement, 'elementType' | 'elementId' | 'extBufForUI'>;
|
||||
|
||||
@@ -253,7 +253,7 @@ export interface FaceBubbleElement {
|
||||
faceFlag: number;
|
||||
content: string;
|
||||
oldVersionStr: string;
|
||||
faceType: number;
|
||||
faceType: FaceType;
|
||||
others: string;
|
||||
yellowFaceInfo: {
|
||||
index: number;
|
||||
|
54
src/core/types/emoji.ts
Normal file
54
src/core/types/emoji.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
export enum PullMomentType {
|
||||
REINSTALL = 0,
|
||||
RESTART_FIRST_AIO = 1,
|
||||
LOGIN_APP = 2,
|
||||
SINGEL_PULL_NOTIFY = 3,
|
||||
TRIGGER_SPECIFIC_EMOJI_RANDOM_RESULT = 4
|
||||
}
|
||||
|
||||
export interface PullSysEmojisReq {
|
||||
fetchAdvaceSource: boolean;
|
||||
fetchBaseSource: boolean;
|
||||
pullMoment: PullMomentType;
|
||||
pullType: number;
|
||||
refresh: boolean;
|
||||
thresholdValue: number;
|
||||
}
|
||||
|
||||
export enum BaseEmojiType {
|
||||
NORMAL_EMOJI = 0,
|
||||
SUPER_EMOJI = 1,
|
||||
RANDOM_SUPER_EMOJI = 2,
|
||||
CHAIN_SUPER_EMOJI = 3,
|
||||
EMOJI_EMOJI = 4
|
||||
}
|
||||
|
||||
export interface GetBaseEmojiPathReq {
|
||||
emojiId: string;
|
||||
type: BaseEmojiType;
|
||||
}
|
||||
export enum EmojiPanelCategory {
|
||||
OTHER_PANEL = 0,
|
||||
NORMAL_PANEL = 1,
|
||||
SUPER_PANEL = 2,
|
||||
RED_HEART_PANEL = 3
|
||||
}
|
||||
|
||||
export interface DownloadBaseEmojiInfo {
|
||||
baseResDownloadUrl: string;
|
||||
advancedResDownloadUrl: string;
|
||||
}
|
||||
|
||||
export interface DownloadBaseEmojiByUrlReq {
|
||||
emojiId: string;
|
||||
groupName: string;
|
||||
panelCategory: EmojiPanelCategory;
|
||||
downloadInfo: DownloadBaseEmojiInfo;
|
||||
}
|
||||
|
||||
export interface DownloadBaseEmojiByIdReq {
|
||||
emojiId: string;
|
||||
groupName: string;
|
||||
panelCategory: EmojiPanelCategory;
|
||||
qzoneCode: string;
|
||||
}
|
74
src/core/types/graytip.ts
Normal file
74
src/core/types/graytip.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
export enum JsonGrayBusiId {
|
||||
AIO_AV_C2C_NOTICE = 2021,
|
||||
AIO_AV_GROUP_NOTICE = 2022,
|
||||
AIO_C2C_DONT_DISTURB = 2100,
|
||||
AIO_CRM_FLAGS_TIPS = 2050,
|
||||
AIO_GROUP_ESSENCE_MSG_TIP = 2401,
|
||||
AIO_NUDGE_CUSTOM_GUIDE = 2041,
|
||||
AIO_PUSH_GUIDE_GRAY_TIPS = 2701,
|
||||
AIO_RECALL_MSGCUSTOM_WORDINGGUIDE = 2000,
|
||||
AIO_ROBOT_SAFETY_TIP = 2201,
|
||||
AIO_ZPLAN_EMOTICON_GUIDE = 2301,
|
||||
AIO_ZPLAN_SCENE_LINKAGE = 2302,
|
||||
AIO_ZPLAN_SEND_MEME = 2300,
|
||||
DISBAND_DISCUSSION_GRAY_TIP_ID = 2603,
|
||||
FILE_SENDING_SIZE_4GB_LIMIT = 3003,
|
||||
GROUP_AIO_CONFIGURABLE_GRAY_TIPS = 2407,
|
||||
GROUP_AIO_HOME_SCHOOL_WELCOME_GRAY_TIP_ID = 2404,
|
||||
GROUP_AIO_MSG_FREQUENCY_GRAY_TIP_ID = 2406,
|
||||
GROUP_AIO_SHUTUP_GRAY_TIP_ID = 2402,
|
||||
GROUP_AIO_TEMPORARY_GRAY_TIP_ID = 2405,
|
||||
GROUP_AIO_UNREAD_MSG_AI_SUMMARY = 2408,
|
||||
GROUP_AIO_UPLOAD_PERMISSIONS_GRAY_TIP_ID = 2403,
|
||||
LITE_ACTION = 86,
|
||||
ONLINE_FILE_CANCEL_RECV_ON_RECVING = 4,
|
||||
ONLINE_FILE_GO_OFFLINE = 11,
|
||||
ONLINE_FILE_GO_OFFLINE_ALL = 12,
|
||||
ONLINE_FILE_RECV_BY_MOBILE = 13,
|
||||
ONLINE_FILE_RECV_ERROR = 10,
|
||||
ONLINE_FILE_REFUSE_ALL_RECV = 7,
|
||||
ONLINE_FILE_REFUSE_ALL_RECV_ON_RECVING = 8,
|
||||
ONLINE_FILE_REFUSE_RECV = 3,
|
||||
ONLINE_FILE_SEND_ERROR = 9,
|
||||
ONLINE_FILE_STOP_ALL_SEND = 5,
|
||||
ONLINE_FILE_STOP_ALL_SEND_ON_SENDING = 6,
|
||||
ONLINE_FILE_STOP_SEND = 1,
|
||||
ONLINE_FILE_STOP_SEND_ON_SENDING = 2,
|
||||
ONLINE_GROUP_HOME_WORK = 51,
|
||||
PTT_AUTO_CHANGE_GUIDE = 2060,
|
||||
QCIRCLE_SHOW_FULE_TIPS = 2601,
|
||||
QWALLET_GRAY_TIP_ID = 2602,
|
||||
RED_BAG = 81,
|
||||
RELATION_C2C_GROUP_AIO_SETUP_GROUP_AND_REMARK = 1005,
|
||||
RELATION_C2C_LOVER_BONUS = 1003,
|
||||
RELATION_C2C_MEMBER_ADD = 1017,
|
||||
RELATION_C2C_REACTIVE_DEGRADE_MSG = 1019,
|
||||
RELATION_C2C_REACTIVE_UPGRADE_MSG = 1018,
|
||||
RELATION_C2C_SAY_HELLO = 1004,
|
||||
RELATION_CHAIN_BLACKED = 1000,
|
||||
RELATION_CHAIN_MATCH_FRIEND = 1007,
|
||||
RELATION_CREATE_GROUP_GRAY_TIP_ID = 1009,
|
||||
RELATION_EMOJIEGG_SHOW = 1001,
|
||||
RELATION_EMOJIEGG_WILL_DEGRADE = 1002,
|
||||
RELATION_FRIEND_CLONE_INFO = 1006,
|
||||
RELATION_GROUP_BATCH_ADD_FRIEND = 1020,
|
||||
RELATION_GROUP_MEMBER_ADD = 1022,
|
||||
RELATION_GROUP_MEMBER_ADD_WITH_MODIFY_NAME = 1015,
|
||||
RELATION_GROUP_MEMBER_ADD_WITH_WELCOME = 1016,
|
||||
RELATION_GROUP_MEMBER_RECOMMEND = 1021,
|
||||
RELATION_GROUP_SHUT_UP = 1014,
|
||||
RELATION_LIMIT_TMP_CONVERSATION_SET = 1011,
|
||||
RELATION_NEARBY_GOTO_VERIFY = 1008,
|
||||
RELATION_ONEWAY_FRIEND_GRAY_TIP_ID = 1012,
|
||||
RELATION_ONEWAY_FRIEND_NEW_GRAY_TIP_ID = 1013,
|
||||
RELATION_YQT = 1010,
|
||||
TROOP_ADD_FRIEND_ACTIVE = 19264,
|
||||
TROOP_ADD_FRIEND_HOT_CHAT = 19265,
|
||||
TROOP_ADD_FRIEND_NEW_MEMBER = 19267,
|
||||
TROOP_ADD_FRIEND_REPLY_OR_AT = 19266,
|
||||
TROOP_BREAK_ICE = 10405,
|
||||
TROOP_FLAME_IGNITED = 19273,
|
||||
UI_RESERVE_100000_110000 = 100000,
|
||||
VAS_FILE_UPLOAD_OVER_1G = 3002,
|
||||
VAS_FILE_UPLOAD_OVER_LIMIT = 3001,
|
||||
}
|
@@ -63,16 +63,16 @@ export interface KickMemberV2Req {
|
||||
|
||||
// 数据来源类型
|
||||
export enum DataSource {
|
||||
LOCAL,
|
||||
REMOTE
|
||||
LOCAL = 0,
|
||||
REMOTE = 1
|
||||
}
|
||||
|
||||
// 群列表更新类型
|
||||
export enum GroupListUpdateType {
|
||||
REFRESHALL,
|
||||
GETALL,
|
||||
MODIFIED,
|
||||
REMOVE
|
||||
REFRESHALL = 0,
|
||||
GETALL = 1,
|
||||
MODIFIED = 2,
|
||||
REMOVE = 3
|
||||
}
|
||||
|
||||
export interface GroupMemberCache {
|
||||
|
@@ -7,4 +7,6 @@ export * from './system';
|
||||
export * from './webapi';
|
||||
export * from './sign';
|
||||
export * from './element';
|
||||
export * from './constant';
|
||||
export * from './constant';
|
||||
export * from './graytip';
|
||||
export * from './emoji';
|
@@ -1,6 +1,10 @@
|
||||
import { NTGroupMemberRole } from '@/core';
|
||||
import { ActionBarElement, ArkElement, AvRecordElement, CalendarElement, FaceBubbleElement, FaceElement, FileElement, GiphyElement, GrayTipElement, MarketFaceElement, PicElement, PttElement, RecommendedMsgElement, ReplyElement, ShareLocationElement, StructLongMsgElement, TaskTopMsgElement, TextElement, TofuRecordElement, VideoElement, YoloGameResultElement } from './element';
|
||||
|
||||
/*
|
||||
* 2024/11/22 Refactor Mlikiowa
|
||||
*/
|
||||
|
||||
/**
|
||||
* 表示对等方的信息
|
||||
*/
|
||||
@@ -127,7 +131,7 @@ export enum PicSubType {
|
||||
KRELATED = 7
|
||||
}
|
||||
/**
|
||||
* 消息@类型枚举
|
||||
* 消息AT类型枚举
|
||||
*/
|
||||
export enum NTMsgAtType {
|
||||
ATTYPEALL = 1,
|
||||
@@ -260,16 +264,6 @@ export enum NTGrayTipElementSubTypeV2 {
|
||||
GRAYTIP_ELEMENT_SUBTYPE_XMLMSG = 12,
|
||||
}
|
||||
|
||||
/**
|
||||
* 表情类型枚举
|
||||
*/
|
||||
export enum FaceType {
|
||||
normal = 1, // 小黄脸
|
||||
normal2 = 2, // 新小黄脸
|
||||
dice = 3, // 骰子
|
||||
poke = 5 // 拍一拍
|
||||
}
|
||||
|
||||
/**
|
||||
* Poke 类型枚举
|
||||
*/
|
||||
@@ -288,8 +282,8 @@ export enum PokeType {
|
||||
* 表情索引枚举
|
||||
*/
|
||||
export enum FaceIndex {
|
||||
dice = 358,
|
||||
rps = 359
|
||||
DICE = 358,
|
||||
RPS = 359
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -532,4 +526,16 @@ export interface MsgReqType {
|
||||
includeSelf: boolean,
|
||||
includeDeleteMsg: boolean,
|
||||
extraCnt: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 表情类型枚举
|
||||
*/
|
||||
export enum FaceType {
|
||||
Unknown = 0,
|
||||
OldFace = 1, // 老表情
|
||||
Normal = 2, // 常规表情
|
||||
AniSticke = 3, // 动画贴纸
|
||||
Lottie = 4,// 新格式表情
|
||||
Poke = 5 // 可变Poke
|
||||
}
|
@@ -1,20 +1,20 @@
|
||||
export enum GroupNotifyMsgType {
|
||||
UN_SPECIFIED,
|
||||
INVITED_BY_MEMBER,
|
||||
REFUSE_INVITED,
|
||||
REFUSED_BY_ADMINI_STRATOR,
|
||||
AGREED_TOJOIN_DIRECT,// 有人接受了邀请入群
|
||||
INVITED_NEED_ADMINI_STRATOR_PASS,
|
||||
AGREED_TO_JOIN_BY_ADMINI_STRATOR,
|
||||
REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS,
|
||||
SET_ADMIN,
|
||||
KICK_MEMBER_NOTIFY_ADMIN,
|
||||
KICK_MEMBER_NOTIFY_KICKED,
|
||||
MEMBER_LEAVE_NOTIFY_ADMIN,// 主动退出
|
||||
CANCEL_ADMIN_NOTIFY_CANCELED,
|
||||
CANCEL_ADMIN_NOTIFY_ADMIN,// 其他人取消管理员
|
||||
TRANSFER_GROUP_NOTIFY_OLDOWNER,
|
||||
TRANSFER_GROUP_NOTIFY_ADMIN
|
||||
UN_SPECIFIED = 0,
|
||||
INVITED_BY_MEMBER = 1,
|
||||
REFUSE_INVITED = 2,
|
||||
REFUSED_BY_ADMINI_STRATOR = 3,
|
||||
AGREED_TOJOIN_DIRECT = 4,// 有人接受了邀请入群
|
||||
INVITED_NEED_ADMINI_STRATOR_PASS = 5,
|
||||
AGREED_TO_JOIN_BY_ADMINI_STRATOR = 6,
|
||||
REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS = 7,
|
||||
SET_ADMIN = 8,
|
||||
KICK_MEMBER_NOTIFY_ADMIN = 9,
|
||||
KICK_MEMBER_NOTIFY_KICKED = 10,
|
||||
MEMBER_LEAVE_NOTIFY_ADMIN = 11,// 主动退出
|
||||
CANCEL_ADMIN_NOTIFY_CANCELED = 12,
|
||||
CANCEL_ADMIN_NOTIFY_ADMIN = 13,// 其他人取消管理员
|
||||
TRANSFER_GROUP_NOTIFY_OLDOWNER = 14,
|
||||
TRANSFER_GROUP_NOTIFY_ADMIN = 15
|
||||
}
|
||||
|
||||
export interface GroupNotifies {
|
||||
@@ -24,24 +24,24 @@ export interface GroupNotifies {
|
||||
}
|
||||
|
||||
export enum GroupNotifyMsgStatus {
|
||||
KINIT,//初始化
|
||||
KUNHANDLE,//未处理
|
||||
KAGREED,//同意
|
||||
KREFUSED,//拒绝
|
||||
KIGNORED//忽略
|
||||
KINIT = 0,//初始化
|
||||
KUNHANDLE = 1,//未处理
|
||||
KAGREED = 2,//同意
|
||||
KREFUSED = 3,//拒绝
|
||||
KIGNORED = 4//忽略
|
||||
}
|
||||
|
||||
export enum GroupInviteStatus {
|
||||
INIT,
|
||||
WAIT_TO_APPROVE,
|
||||
JOINED,
|
||||
REFUSED_BY_ADMINI_STRATOR
|
||||
INIT = 0,
|
||||
WAIT_TO_APPROVE = 1,
|
||||
JOINED = 2,
|
||||
REFUSED_BY_ADMINI_STRATOR = 3
|
||||
}
|
||||
|
||||
export enum GroupInviteType {
|
||||
BYBUDDY,
|
||||
BYGROUPMEMBER,
|
||||
BYDISCUSSMEMBER
|
||||
BYBUDDY = 0,
|
||||
BYGROUPMEMBER = 1,
|
||||
BYDISCUSSMEMBER = 2
|
||||
}
|
||||
export interface ShutUpGroupHonor {
|
||||
[key: string]: number;
|
||||
@@ -116,20 +116,20 @@ export enum NTGroupRequestOperateTypes {
|
||||
}
|
||||
|
||||
export enum BuddyReqType {
|
||||
KMEINITIATOR,
|
||||
KPEERINITIATOR,
|
||||
KMEAGREED,
|
||||
KMEAGREEDANDADDED,
|
||||
KPEERAGREED,
|
||||
KPEERAGREEDANDADDED,
|
||||
KPEERREFUSED,
|
||||
KMEREFUSED,
|
||||
KMEIGNORED,
|
||||
KMEAGREEANYONE,
|
||||
KMESETQUESTION,
|
||||
KMEAGREEANDADDFAILED,
|
||||
KMSGINFO,
|
||||
KMEINITIATORWAITPEERCONFIRM
|
||||
KMEINITIATOR = 0,
|
||||
KPEERINITIATOR = 1,
|
||||
KMEAGREED = 2,
|
||||
KMEAGREEDANDADDED = 3,
|
||||
KPEERAGREED = 4,
|
||||
KPEERAGREEDANDADDED = 5,
|
||||
KPEERREFUSED = 6,
|
||||
KMEREFUSED = 7,
|
||||
KMEIGNORED = 8,
|
||||
KMEAGREEANYONE = 9,
|
||||
KMESETQUESTION = 10,
|
||||
KMEAGREEANDADDFAILED = 11,
|
||||
KMSGINFO = 12,
|
||||
KMEINITIATORWAITPEERCONFIRM = 13
|
||||
}
|
||||
|
||||
export interface FriendRequest {
|
||||
|
@@ -322,8 +322,8 @@ export type Friend = User;
|
||||
|
||||
// 业务键枚举
|
||||
export enum BizKey {
|
||||
KPRIVILEGEICON,
|
||||
KPHOTOWALL
|
||||
KPRIVILEGEICON = 0,
|
||||
KPHOTOWALL = 1
|
||||
}
|
||||
|
||||
// 根据UIN获取用户详细信息
|
||||
@@ -347,9 +347,9 @@ export enum UserDetailSource {
|
||||
|
||||
// 个人资料业务类型枚举
|
||||
export enum ProfileBizType {
|
||||
KALL,
|
||||
KBASEEXTEND,
|
||||
KVAS,
|
||||
KQZONE,
|
||||
KOTHER
|
||||
KALL = 0,
|
||||
KBASEEXTEND = 1,
|
||||
KVAS = 2,
|
||||
KQZONE = 3,
|
||||
KOTHER = 4
|
||||
}
|
@@ -1,18 +1,31 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
interface Payload {
|
||||
start: number,
|
||||
count: number
|
||||
}
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user_id: { type: ['number', 'string'] },
|
||||
start: { type: ['number', 'string'] },
|
||||
count: { type: ['number', 'string'] },
|
||||
type: { type: ['number', 'string'] },
|
||||
},
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetProfileLike extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.GetProfileLike;
|
||||
|
||||
payloadSchema = SchemaData;
|
||||
async _handle(payload: Payload) {
|
||||
const start = payload.start ? Number(payload.start) : 0;
|
||||
const count = payload.count ? Number(payload.count) : 10;
|
||||
const ret = await this.core.apis.UserApi.getProfileLike(this.core.selfInfo.uid, start, count);
|
||||
const type = payload.count ? Number(payload.count) : 2;
|
||||
const user_uid =
|
||||
this.core.selfInfo.uin === payload.user_id || !payload.user_id ?
|
||||
this.core.selfInfo.uid :
|
||||
await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||
const ret = await this.core.apis.UserApi.getProfileLike(user_uid ?? this.core.selfInfo.uid, start, count, type);
|
||||
const listdata = ret.info.userLikeInfos[0].voteInfo.userInfos;
|
||||
for (const item of listdata) {
|
||||
item.uin = parseInt((await this.core.apis.UserApi.getUinByUidV2(item.uid)) || '');
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { GetPacketStatusDepends } from '../packet/GetPacketStatus';
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import SendMsg, { normalize } from '../msg/SendMsg';
|
||||
import { OB11PostSendMsg } from '../../types';
|
||||
import SendMsg, { normalize } from '@/onebot/action/msg/SendMsg';
|
||||
import { OB11PostSendMsg } from '@/onebot/types';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
|
||||
// 未验证
|
||||
|
@@ -5,7 +5,7 @@ import fs from 'fs';
|
||||
import { uri2local } from '@/common/file';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageContext } from '@/onebot/api';
|
||||
import { ContextMode, createContext } from '../msg/SendMsg';
|
||||
import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import SendMsg, { ContextMode } from '../msg/SendMsg';
|
||||
import { ActionName, BaseCheckResult } from '../router';
|
||||
import { OB11PostSendMsg } from '../../types';
|
||||
import SendMsg, { ContextMode } from '@/onebot/action/msg/SendMsg';
|
||||
import { ActionName, BaseCheckResult } from '@/onebot/action/router';
|
||||
import { OB11PostSendMsg } from '@/onebot/types';
|
||||
|
||||
// 未检测参数
|
||||
class SendGroupMsg extends SendMsg {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import SendMsg, { ContextMode } from './SendMsg';
|
||||
import { ActionName, BaseCheckResult } from '../router';
|
||||
import { OB11PostSendMsg } from '../../types';
|
||||
import { ActionName, BaseCheckResult } from '@/onebot/action/router';
|
||||
import { OB11PostSendMsg } from '@/onebot/types';
|
||||
|
||||
// 未检测参数
|
||||
class SendPrivateMsg extends SendMsg {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName, BaseCheckResult } from '../router';
|
||||
import { ActionName, BaseCheckResult } from '@/onebot/action/router';
|
||||
|
||||
|
||||
export abstract class GetPacketStatusDepends<PT, RT> extends OneBotAction<PT, RT> {
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { GrayTipElement, NapCatCore } from '@/core';
|
||||
|
||||
import { NapCatOneBot11Adapter } from '@/onebot';
|
||||
import { OB11FriendPokeEvent } from '../event/notice/OB11PokeEvent';
|
||||
import { OB11FriendPokeEvent } from '@/onebot/event/notice/OB11PokeEvent';
|
||||
|
||||
export class OneBotFriendApi {
|
||||
obContext: NapCatOneBot11Adapter;
|
||||
|
@@ -1,17 +1,18 @@
|
||||
import {
|
||||
ChatType,
|
||||
GrayTipElement,
|
||||
JsonGrayBusiId,
|
||||
NapCatCore,
|
||||
NTGrayTipElementSubTypeV2,
|
||||
RawMessage,
|
||||
TipGroupElementType,
|
||||
} from '@/core';
|
||||
import { NapCatOneBot11Adapter } from '@/onebot';
|
||||
import { OB11GroupBanEvent } from '../event/notice/OB11GroupBanEvent';
|
||||
import { OB11GroupIncreaseEvent } from '../event/notice/OB11GroupIncreaseEvent';
|
||||
import { OB11GroupDecreaseEvent } from '../event/notice/OB11GroupDecreaseEvent';
|
||||
import { OB11GroupBanEvent } from '@/onebot/event/notice/OB11GroupBanEvent';
|
||||
import { OB11GroupIncreaseEvent } from '@/onebot/event/notice/OB11GroupIncreaseEvent';
|
||||
import { OB11GroupDecreaseEvent } from '@/onebot/event/notice/OB11GroupDecreaseEvent';
|
||||
import fastXmlParser from 'fast-xml-parser';
|
||||
import { OB11GroupMsgEmojiLikeEvent } from '../event/notice/OB11MsgEmojiLikeEvent';
|
||||
import { OB11GroupMsgEmojiLikeEvent } from '@/onebot/event/notice/OB11MsgEmojiLikeEvent';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import { OB11GroupCardEvent } from '@/onebot/event/notice/OB11GroupCardEvent';
|
||||
import { OB11GroupUploadNoticeEvent } from '@/onebot/event/notice/OB11GroupUploadNoticeEvent';
|
||||
@@ -115,7 +116,7 @@ export class OneBotGroupApi {
|
||||
);
|
||||
}
|
||||
}
|
||||
if (element.grayTipElement.jsonGrayTipElement.busiId == 2401) {
|
||||
if (element.grayTipElement.jsonGrayTipElement.busiId == JsonGrayBusiId.AIO_GROUP_ESSENCE_MSG_TIP) {
|
||||
const searchParams = new URL(json.items[0].jp).searchParams;
|
||||
const msgSeq = searchParams.get('msgSeq')!;
|
||||
const Group = searchParams.get('groupCode');
|
||||
@@ -138,7 +139,7 @@ export class OneBotGroupApi {
|
||||
);
|
||||
// 获取MsgSeq+Peer可获取具体消息
|
||||
}
|
||||
if (element.grayTipElement.jsonGrayTipElement.busiId == 2407) {
|
||||
if (element.grayTipElement.jsonGrayTipElement.busiId == JsonGrayBusiId.GROUP_AIO_CONFIGURABLE_GRAY_TIPS) {
|
||||
const type = json.items[json.items.length - 1]?.txt;
|
||||
if (type === "头衔") {
|
||||
const memberUin = json.items[1].param[0];
|
||||
|
@@ -7,7 +7,6 @@ import {
|
||||
CustomMusicSignPostData,
|
||||
ElementType,
|
||||
FaceIndex,
|
||||
FaceType,
|
||||
IdMusicSignPostData,
|
||||
MessageElement,
|
||||
NapCatCore,
|
||||
@@ -16,6 +15,8 @@ import {
|
||||
RawMessage,
|
||||
SendMessageElement,
|
||||
SendTextElement,
|
||||
BaseEmojiType,
|
||||
FaceType,
|
||||
} from '@/core';
|
||||
import faceConfig from '@/core/external/face_config.json';
|
||||
import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, } from '@/onebot';
|
||||
@@ -144,14 +145,14 @@ export class OneBotMsgApi {
|
||||
|
||||
faceElement: async element => {
|
||||
const faceIndex = element.faceIndex;
|
||||
if (faceIndex === FaceIndex.dice) {
|
||||
if (faceIndex === FaceIndex.DICE) {
|
||||
return {
|
||||
type: OB11MessageDataType.dice,
|
||||
data: {
|
||||
result: element.resultId!,
|
||||
},
|
||||
};
|
||||
} else if (faceIndex === FaceIndex.rps) {
|
||||
} else if (faceIndex === FaceIndex.RPS) {
|
||||
return {
|
||||
type: OB11MessageDataType.rps,
|
||||
data: {
|
||||
@@ -546,8 +547,8 @@ export class OneBotMsgApi {
|
||||
elementType: ElementType.FACE,
|
||||
elementId: '',
|
||||
faceElement: {
|
||||
faceIndex: FaceIndex.dice,
|
||||
faceType: FaceType.dice,
|
||||
faceIndex: FaceIndex.DICE,
|
||||
faceType: FaceType.AniSticke,
|
||||
faceText: '[骰子]',
|
||||
packId: '1',
|
||||
stickerId: '33',
|
||||
@@ -562,9 +563,9 @@ export class OneBotMsgApi {
|
||||
elementType: ElementType.FACE,
|
||||
elementId: '',
|
||||
faceElement: {
|
||||
faceIndex: FaceIndex.rps,
|
||||
faceIndex: FaceIndex.RPS,
|
||||
faceText: '[包剪锤]',
|
||||
faceType: 3,
|
||||
faceType: FaceType.AniSticke,
|
||||
packId: '1',
|
||||
stickerId: '34',
|
||||
sourceType: 1,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { NapCatCore } from '@/core';
|
||||
import { NapCatOneBot11Adapter } from '@/onebot';
|
||||
import { OB11ProfileLikeEvent } from '../event/notice/OB11ProfileLikeEvent';
|
||||
import { OB11ProfileLikeEvent } from '@/onebot/event/notice/OB11ProfileLikeEvent';
|
||||
import { decodeProfileLikeTip } from "@/core/helper/adaptDecoder";
|
||||
|
||||
export class OneBotUserApi {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { EventType, OneBotEvent } from '../OneBotEvent';
|
||||
import { EventType, OneBotEvent } from '@/onebot/event/OneBotEvent';
|
||||
|
||||
export abstract class OB11BaseMessageEvent extends OneBotEvent {
|
||||
post_type = EventType.MESSAGE;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { OB11BaseNoticeEvent } from '../notice/OB11BaseNoticeEvent';
|
||||
import { EventType } from '../OneBotEvent';
|
||||
import { OB11BaseNoticeEvent } from '@/onebot/event/notice/OB11BaseNoticeEvent';
|
||||
import { EventType } from '@/onebot/event/OneBotEvent';
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { OB11GroupNoticeEvent } from '../notice/OB11GroupNoticeEvent';
|
||||
import { EventType } from '../OneBotEvent';
|
||||
import { OB11GroupNoticeEvent } from '@/onebot/event/notice/OB11GroupNoticeEvent';
|
||||
import { EventType } from '@/onebot/event/OneBotEvent';
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
export class OB11GroupRequestEvent extends OB11GroupNoticeEvent {
|
||||
|
@@ -5,8 +5,8 @@ import { QuickAction, QuickActionEvent } from '@/onebot/types';
|
||||
import { NapCatCore } from '@/core';
|
||||
import { NapCatOneBot11Adapter } from '..';
|
||||
import { RequestUtil } from '@/common/request';
|
||||
import { HttpClientConfig } from '../config/config';
|
||||
import { ActionMap } from '../action';
|
||||
import { HttpClientConfig } from '@/onebot/config/config';
|
||||
import { ActionMap } from '@/onebot/action';
|
||||
|
||||
export class OB11ActiveHttpAdapter implements IOB11NetworkAdapter {
|
||||
logger: LogWrapper;
|
||||
|
@@ -1,13 +1,13 @@
|
||||
import { IOB11NetworkAdapter, OB11EmitEventContent, OB11NetworkReloadType } from '@/onebot/network/index';
|
||||
import { WebSocket } from 'ws';
|
||||
import { OB11HeartbeatEvent } from '../event/meta/OB11HeartbeatEvent';
|
||||
import { OB11HeartbeatEvent } from '@/onebot/event/meta/OB11HeartbeatEvent';
|
||||
import { NapCatCore } from '@/core';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { OB11Response } from '@/onebot/action/OneBotAction';
|
||||
import { LogWrapper } from '@/common/log';
|
||||
import { ActionMap } from '@/onebot/action';
|
||||
import { LifeCycleSubType, OB11LifeCycleEvent } from '../event/meta/OB11LifeCycleEvent';
|
||||
import { WebsocketClientConfig } from '../config/config';
|
||||
import { LifeCycleSubType, OB11LifeCycleEvent } from '@/onebot/event/meta/OB11LifeCycleEvent';
|
||||
import { WebsocketClientConfig } from '@/onebot/config/config';
|
||||
|
||||
export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
||||
isEnable: boolean = false;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { OneBotEvent } from '@/onebot/event/OneBotEvent';
|
||||
import { OB11Message } from '@/onebot';
|
||||
import { ActionMap } from '@/onebot/action';
|
||||
import { NetworkConfigAdapter } from '../config/config';
|
||||
import { NetworkConfigAdapter } from '@/onebot/config/config';
|
||||
|
||||
export type OB11EmitEventContent = OneBotEvent | OB11Message;
|
||||
export enum OB11NetworkReloadType {
|
||||
|
@@ -5,7 +5,7 @@ import { NapCatCore } from '@/core';
|
||||
import { OB11Response } from '@/onebot/action/OneBotAction';
|
||||
import { ActionMap } from '@/onebot/action';
|
||||
import cors from 'cors';
|
||||
import { HttpServerConfig } from '../config/config';
|
||||
import { HttpServerConfig } from '@/onebot/config/config';
|
||||
|
||||
export class OB11PassiveHttpAdapter implements IOB11NetworkAdapter {
|
||||
private app: Express | undefined;
|
||||
|
@@ -3,14 +3,14 @@ import urlParse from 'url';
|
||||
import { WebSocket, WebSocketServer } from 'ws';
|
||||
import { Mutex } from 'async-mutex';
|
||||
import { OB11Response } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../action/router';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { NapCatCore } from '@/core';
|
||||
import { LogWrapper } from '@/common/log';
|
||||
import { OB11HeartbeatEvent } from '../event/meta/OB11HeartbeatEvent';
|
||||
import { OB11HeartbeatEvent } from '@/onebot/event/meta/OB11HeartbeatEvent';
|
||||
import { IncomingMessage } from 'http';
|
||||
import { ActionMap } from '@/onebot/action';
|
||||
import { LifeCycleSubType, OB11LifeCycleEvent } from '../event/meta/OB11LifeCycleEvent';
|
||||
import { WebsocketServerConfig } from '../config/config';
|
||||
import { LifeCycleSubType, OB11LifeCycleEvent } from '@/onebot/event/meta/OB11LifeCycleEvent';
|
||||
import { WebsocketServerConfig } from '@/onebot/config/config';
|
||||
|
||||
export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
|
||||
wsServer: WebSocketServer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { OB11BaseMetaEvent } from '../event/meta/OB11BaseMetaEvent';
|
||||
import { OB11BaseNoticeEvent } from '../event/notice/OB11BaseNoticeEvent';
|
||||
import { OB11Message } from './message';
|
||||
import { OB11BaseMetaEvent } from '@/onebot/event/meta/OB11BaseMetaEvent';
|
||||
import { OB11BaseNoticeEvent } from '@/onebot/event/notice/OB11BaseNoticeEvent';
|
||||
import { OB11Message } from '@/onebot/types/message';
|
||||
|
||||
export type QuickActionEvent = OB11Message | OB11BaseMetaEvent | OB11BaseNoticeEvent;
|
||||
export type PostEventType = OB11Message | OB11BaseMetaEvent | OB11BaseNoticeEvent;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { RequestHandler } from 'express';
|
||||
import { WebUiDataRuntime } from '../helper/Data';
|
||||
|
||||
export const LogFileListHandler: RequestHandler = async (req, res) => {
|
||||
res.send({
|
||||
|
Reference in New Issue
Block a user