mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
update: bump laana to v0.6.0
This commit is contained in:
parent
dc98a1dac2
commit
3cb158ec98
@ -46,7 +46,7 @@
|
|||||||
"vite-tsconfig-paths": "^4.3.2"
|
"vite-tsconfig-paths": "^4.3.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@laana-proto/def": "^0.5.2",
|
"@laana-proto/def": "^0.6.0",
|
||||||
"express": "5.0.0",
|
"express": "5.0.0",
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
|
@ -2,7 +2,7 @@ import { NapCatLaanaAdapter } from '..';
|
|||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
import { LaanaActionHandler } from '../action';
|
import { LaanaActionHandler } from '../action';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { ForwardMessagePing_Operation, LaanaPeer, OutgoingMessage } from '@laana-proto/def';
|
import { ForwardMessagePing_Operation, LaanaPeer, LaanaOutgoingMessage } from '@laana-proto/def';
|
||||||
|
|
||||||
export class LaanaMessageActionImpl {
|
export class LaanaMessageActionImpl {
|
||||||
constructor(
|
constructor(
|
||||||
@ -68,7 +68,7 @@ export class LaanaMessageActionImpl {
|
|||||||
* @param targetPeer The peer to send the message to.
|
* @param targetPeer The peer to send the message to.
|
||||||
* @returns The Laana-styled msgId of the message sent.
|
* @returns The Laana-styled msgId of the message sent.
|
||||||
*/
|
*/
|
||||||
async sendMessage(msg: OutgoingMessage, targetPeer: LaanaPeer) {
|
async sendMessage(msg: LaanaOutgoingMessage, targetPeer: LaanaPeer) {
|
||||||
const { elements, fileCacheRecords } = await this.laana.utils.msg.laanaMessageToRaw(msg, targetPeer);
|
const { elements, fileCacheRecords } = await this.laana.utils.msg.laanaMessageToRaw(msg, targetPeer);
|
||||||
|
|
||||||
let cacheSize = 0;
|
let cacheSize = 0;
|
||||||
|
@ -4,6 +4,7 @@ import { RawData, WebSocket, WebSocketServer } from 'ws';
|
|||||||
import { Mutex } from 'async-mutex';
|
import { Mutex } from 'async-mutex';
|
||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
import { LaanaDataWrapper, LaanaEventWrapper, LaanaMessage, LaanaServerSideHandshake_Result } from '@laana-proto/def';
|
import { LaanaDataWrapper, LaanaEventWrapper, LaanaMessage, LaanaServerSideHandshake_Result } from '@laana-proto/def';
|
||||||
|
import { napCatVersion } from '@/common/version';
|
||||||
|
|
||||||
export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
||||||
wsServer: WebSocketServer;
|
wsServer: WebSocketServer;
|
||||||
@ -48,6 +49,7 @@ export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
|||||||
oneofKind: 'serverSideHandshake',
|
oneofKind: 'serverSideHandshake',
|
||||||
serverSideHandshake: {
|
serverSideHandshake: {
|
||||||
serverVersion: '',
|
serverVersion: '',
|
||||||
|
serverName: `NapCatQQ-${napCatVersion}`,
|
||||||
result: LaanaServerSideHandshake_Result.wrongToken,
|
result: LaanaServerSideHandshake_Result.wrongToken,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -61,6 +63,7 @@ export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
|||||||
oneofKind: 'serverSideHandshake',
|
oneofKind: 'serverSideHandshake',
|
||||||
serverSideHandshake: {
|
serverSideHandshake: {
|
||||||
serverVersion: '',
|
serverVersion: '',
|
||||||
|
serverName: `NapCatQQ-${napCatVersion}`,
|
||||||
result: LaanaServerSideHandshake_Result.success,
|
result: LaanaServerSideHandshake_Result.success,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@ import {
|
|||||||
LaanaMessage_Bubble,
|
LaanaMessage_Bubble,
|
||||||
LaanaPeer,
|
LaanaPeer,
|
||||||
LaanaPeer_Type,
|
LaanaPeer_Type,
|
||||||
OutgoingMessage,
|
LaanaOutgoingMessage,
|
||||||
} from '@laana-proto/def';
|
} from '@laana-proto/def';
|
||||||
import faceConfig from '@/core/external/face_config.json';
|
import faceConfig from '@/core/external/face_config.json';
|
||||||
import { MessageContext } from '@/onebot/api';
|
import { MessageContext } from '@/onebot/api';
|
||||||
@ -27,7 +27,7 @@ export type SentMessageFileCacheRecord = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type Laana2RawConverters = {
|
type Laana2RawConverters = {
|
||||||
[key in Exclude<OutgoingMessage['content']['oneofKind'], undefined>]:
|
[key in Exclude<LaanaOutgoingMessage['content']['oneofKind'], undefined>]:
|
||||||
(
|
(
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -268,6 +268,10 @@ export class LaanaMessageUtils {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
forwardedMessage: async msgContent => {
|
||||||
|
throw Error('Unimplemented');
|
||||||
|
},
|
||||||
|
|
||||||
musicCard: () => { throw Error('Unimplemented'); },
|
musicCard: () => { throw Error('Unimplemented'); },
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -297,7 +301,7 @@ export class LaanaMessageUtils {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async laanaMessageToRaw(msg: OutgoingMessage, targetPeer: LaanaPeer) {
|
async laanaMessageToRaw(msg: LaanaOutgoingMessage, targetPeer: LaanaPeer) {
|
||||||
if (!msg.content.oneofKind) {
|
if (!msg.content.oneofKind) {
|
||||||
throw Error('消息内容类型未知');
|
throw Error('消息内容类型未知');
|
||||||
}
|
}
|
||||||
|
0
src/laana/utils/user.ts
Normal file
0
src/laana/utils/user.ts
Normal file
Loading…
x
Reference in New Issue
Block a user