mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
opt
This commit is contained in:
parent
c5b69561af
commit
6c8d3db3a4
@ -52,7 +52,7 @@ import { GroupDecreaseSubType, OB11GroupDecreaseEvent } from '../onebot11/event/
|
||||
import '../ntqqapi/wrapper'
|
||||
import { sentMessages } from '@/ntqqapi/api'
|
||||
import { NTEventDispatch } from '../common/utils/EventTask'
|
||||
import { wrapperApi, wrapperConstructor } from '../ntqqapi/wrapper'
|
||||
import { wrapperConstructor, getSession } from '../ntqqapi/wrapper'
|
||||
|
||||
let mainWindow: BrowserWindow | null = null
|
||||
|
||||
@ -441,7 +441,7 @@ function onLoad() {
|
||||
uidMaps[value] = key
|
||||
}
|
||||
})
|
||||
NTEventDispatch.init({ ListenerMap: wrapperConstructor, WrapperSession: wrapperApi.NodeIQQNTWrapperSession! })
|
||||
NTEventDispatch.init({ ListenerMap: wrapperConstructor, WrapperSession: getSession()! })
|
||||
log('start activate group member info')
|
||||
NTQQGroupApi.activateMemberInfoChange().then().catch(log)
|
||||
NTQQGroupApi.activateMemberListChange().then().catch(log)
|
||||
|
@ -16,12 +16,12 @@ import fs from 'node:fs'
|
||||
import { ReceiveCmdS } from '../hook'
|
||||
import { log } from '@/common/utils'
|
||||
import { rkeyManager } from '@/ntqqapi/api/rkey'
|
||||
import { wrapperApi } from '@/ntqqapi/wrapper'
|
||||
import { getSession } from '@/ntqqapi/wrapper'
|
||||
import { Peer } from '@/ntqqapi/types/msg'
|
||||
|
||||
export class NTQQFileApi {
|
||||
static async getVideoUrl(peer: Peer, msgId: string, elementId: string): Promise<string> {
|
||||
const session = wrapperApi.NodeIQQNTWrapperSession
|
||||
const session = getSession()
|
||||
return (await session?.getRichMediaService().getVideoPlayUrlV2(peer,
|
||||
msgId,
|
||||
elementId,
|
||||
|
@ -6,7 +6,7 @@ import { ReceiveCmdS, registerReceiveHook } from '../hook'
|
||||
import { log } from '../../common/utils/log'
|
||||
import { sleep } from '../../common/utils/helper'
|
||||
import { isQQ998 } from '../../common/utils'
|
||||
import { wrapperApi } from '@/ntqqapi/wrapper'
|
||||
import { getSession } from '@/ntqqapi/wrapper'
|
||||
|
||||
export let sendMessagePool: Record<string, ((sendSuccessMsg: RawMessage) => void) | null> = {} // peerUid: callbackFunc
|
||||
|
||||
@ -289,7 +289,7 @@ export class NTQQMsgApi {
|
||||
})
|
||||
}
|
||||
static async getMsgsBySeqAndCount(peer: Peer, seq: string, count: number, desc: boolean, z: boolean) {
|
||||
const session = wrapperApi.NodeIQQNTWrapperSession
|
||||
const session = getSession()
|
||||
return await session?.getMsgService().getMsgsBySeqAndCount(peer, seq, count, desc, z);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ export interface WrapperConstructor {
|
||||
NodeIKernelProfileListener?: any
|
||||
}
|
||||
|
||||
export const wrapperApi: WrapperApi = {}
|
||||
const wrapperApi: WrapperApi = {}
|
||||
|
||||
export const wrapperConstructor: WrapperConstructor = {}
|
||||
|
||||
@ -76,5 +76,5 @@ Process.dlopen = function (module, filename, flags = os.constants.dlopen.RTLD_LA
|
||||
}
|
||||
|
||||
export function getSession() {
|
||||
return wrapperApi.NodeIQQNTWrapperSession
|
||||
return wrapperApi['NodeIQQNTWrapperSession']
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user