mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix
This commit is contained in:
@@ -205,7 +205,7 @@ function onBrowserWindowCreated(window: BrowserWindow) {
|
|||||||
if (window.id === 2) {
|
if (window.id === 2) {
|
||||||
mainWindow = window
|
mainWindow = window
|
||||||
}
|
}
|
||||||
log('window create', window.webContents.getURL().toString())
|
//log('window create', window.webContents.getURL().toString())
|
||||||
try {
|
try {
|
||||||
hookNTQQApiCall(window, window.id !== 2)
|
hookNTQQApiCall(window, window.id !== 2)
|
||||||
hookNTQQApiReceive(window, window.id !== 2)
|
hookNTQQApiReceive(window, window.id !== 2)
|
||||||
|
@@ -43,14 +43,49 @@ export class NTQQFileApi extends Service {
|
|||||||
this.rkeyManager = new RkeyManager(ctx, 'http://napcat-sign.wumiao.wang:2082/rkey')
|
this.rkeyManager = new RkeyManager(ctx, 'http://napcat-sign.wumiao.wang:2082/rkey')
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 27187 TODO */
|
|
||||||
async getVideoUrl(peer: Peer, msgId: string, elementId: string) {
|
async getVideoUrl(peer: Peer, msgId: string, elementId: string) {
|
||||||
const session = getSession()
|
const session = getSession()
|
||||||
return (await session?.getRichMediaService().getVideoPlayUrlV2(peer,
|
if (session) {
|
||||||
msgId,
|
return (await session.getRichMediaService().getVideoPlayUrlV2(
|
||||||
elementId,
|
peer,
|
||||||
0,
|
msgId,
|
||||||
{ downSourceType: 1, triggerType: 1 }))?.urlResult.domainUrl[0].url
|
elementId,
|
||||||
|
0,
|
||||||
|
{ downSourceType: 1, triggerType: 1 }
|
||||||
|
)).urlResult.domainUrl[0]?.url
|
||||||
|
} else {
|
||||||
|
const data = await invoke<GeneralCallResult & {
|
||||||
|
urlResult: {
|
||||||
|
v4IpUrl: []
|
||||||
|
v6IpUrl: []
|
||||||
|
domainUrl: {
|
||||||
|
url: string
|
||||||
|
isHttps: boolean
|
||||||
|
httpsDomain: string
|
||||||
|
}[]
|
||||||
|
videoCodecFormat: number
|
||||||
|
}
|
||||||
|
}>({
|
||||||
|
methodName: 'nodeIKernelRichMediaService/getVideoPlayUrlV2',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
peer,
|
||||||
|
msgId,
|
||||||
|
elemId: elementId,
|
||||||
|
videoCodecFormat: 0,
|
||||||
|
exParams: {
|
||||||
|
downSourceType: 1,
|
||||||
|
triggerType: 1
|
||||||
|
},
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
if (data.result !== 0) {
|
||||||
|
this.ctx.logger.warn('getVideoUrl', data)
|
||||||
|
}
|
||||||
|
return data.urlResult.domainUrl[0]?.url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFileType(filePath: string) {
|
async getFileType(filePath: string) {
|
||||||
|
@@ -157,12 +157,6 @@ export class NTQQGroupApi extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 27187 TODO */
|
|
||||||
async delGroupFile(groupCode: string, files: string[]) {
|
|
||||||
const session = getSession()
|
|
||||||
return session?.getRichMediaService().deleteGroupFile(groupCode, [102], files)
|
|
||||||
}
|
|
||||||
|
|
||||||
async handleGroupRequest(flag: string, operateType: GroupRequestOperateTypes, reason?: string) {
|
async handleGroupRequest(flag: string, operateType: GroupRequestOperateTypes, reason?: string) {
|
||||||
const flagitem = flag.split('|')
|
const flagitem = flag.split('|')
|
||||||
const groupCode = flagitem[0]
|
const groupCode = flagitem[0]
|
||||||
@@ -408,4 +402,18 @@ export class NTQQGroupApi extends Service {
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async deleteGroupFile(groupId: string, fileIdList: string[]) {
|
||||||
|
return await invoke({
|
||||||
|
methodName: 'nodeIKernelRichMediaService/deleteGroupFile',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
groupId,
|
||||||
|
busIdList: [102],
|
||||||
|
fileIdList
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,15 +2,16 @@ import BaseAction from '../BaseAction'
|
|||||||
import { ActionName } from '../types'
|
import { ActionName } from '../types'
|
||||||
|
|
||||||
interface Payload {
|
interface Payload {
|
||||||
group_id: string | number
|
group_id: string | number
|
||||||
file_id: string
|
file_id: string
|
||||||
busid?: 102
|
busid?: 102
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GoCQHTTPDelGroupFile extends BaseAction<Payload, void> {
|
export class GoCQHTTPDelGroupFile extends BaseAction<Payload, null> {
|
||||||
actionName = ActionName.GoCQHTTP_DelGroupFile
|
actionName = ActionName.GoCQHTTP_DelGroupFile
|
||||||
|
|
||||||
async _handle(payload: Payload) {
|
async _handle(payload: Payload) {
|
||||||
await this.ctx.ntGroupApi.delGroupFile(payload.group_id.toString(), [payload.file_id])
|
await this.ctx.ntGroupApi.deleteGroupFile(payload.group_id.toString(), [payload.file_id])
|
||||||
}
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user