mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix
This commit is contained in:
parent
738b0a96a0
commit
6be6151d73
@ -143,7 +143,7 @@ export async function uri2local(uri: string, filename?: string): Promise<Uri2Loc
|
||||
await fsPromise.writeFile(filePath, res.data)
|
||||
return { success: true, errMsg: '', fileName: filename, path: filePath, isLocal: false }
|
||||
} catch (e: any) {
|
||||
const errMsg = `${uri}下载失败,` + e.toString()
|
||||
const errMsg = `${uri} 下载失败, ${e.message}`
|
||||
return { success: false, errMsg, fileName: '', path: '', isLocal: false }
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ export function calcQQLevel(level: QQLevel) {
|
||||
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum
|
||||
}
|
||||
|
||||
/** QQ Build Version */
|
||||
export function getBuildVersion(): number {
|
||||
const version: string = globalThis.LiteLoader.versions.qqnt
|
||||
return +version.split('-')[1]
|
||||
|
@ -303,6 +303,8 @@ export namespace SendMsgElementConstructor {
|
||||
return {
|
||||
elementType: ElementType.MFACE,
|
||||
marketFaceElement: {
|
||||
imageWidth: 300,
|
||||
imageHeight: 300,
|
||||
emojiPackageId,
|
||||
emojiId,
|
||||
key,
|
||||
|
@ -335,6 +335,8 @@ export interface MarketFaceElement {
|
||||
faceName?: string
|
||||
emojiId: string
|
||||
key: string
|
||||
imageWidth?: number
|
||||
imageHeight?: number
|
||||
}
|
||||
|
||||
export interface VideoElement {
|
||||
|
@ -14,9 +14,9 @@ export default class Debug extends BaseAction<Payload, any> {
|
||||
const { ntMsgApi, ntFileApi, ntFileCacheApi, ntFriendApi, ntGroupApi, ntUserApi, ntWindowApi } = this.ctx
|
||||
const ntqqApi = [ntMsgApi, ntFriendApi, ntGroupApi, ntUserApi, ntFileApi, ntFileCacheApi, ntWindowApi]
|
||||
for (const ntqqApiClass of ntqqApi) {
|
||||
const method = ntqqApiClass[payload.method]
|
||||
const method = ntqqApiClass[payload.method] as Function
|
||||
if (method) {
|
||||
const result = method(...payload.args)
|
||||
const result = method.apply(ntqqApiClass, payload.args)
|
||||
if (method.constructor.name === 'AsyncFunction') {
|
||||
return await result
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class OB11Http {
|
||||
this.ctx.logger.error(err)
|
||||
throw err
|
||||
}
|
||||
this.expressAPP[method](url, this.authorize, async (req: Request, res: Response) => {
|
||||
this.expressAPP[method](url, this.authorize.bind(this), async (req: Request, res: Response) => {
|
||||
let payload = req.body
|
||||
if (method == 'get') {
|
||||
payload = req.query
|
||||
|
@ -119,7 +119,7 @@ export async function createSendElements(
|
||||
case OB11MessageDataType.mface: {
|
||||
sendElements.push(
|
||||
SendMsgElementConstructor.mface(
|
||||
sendMsg.data.emoji_package_id,
|
||||
+sendMsg.data.emoji_package_id,
|
||||
sendMsg.data.emoji_id,
|
||||
sendMsg.data.key,
|
||||
sendMsg.data.summary,
|
||||
@ -203,8 +203,8 @@ async function handleOb11FileLikeMessage(
|
||||
} = (await uri2local(inputdata?.url || inputdata.file))
|
||||
|
||||
if (!success) {
|
||||
ctx.logger.error('文件下载失败', errMsg)
|
||||
throw Error('文件下载失败' + errMsg)
|
||||
ctx.logger.error(errMsg)
|
||||
throw Error(errMsg)
|
||||
}
|
||||
|
||||
if (!isLocal) { // 只删除http和base64转过来的文件
|
||||
|
Loading…
x
Reference in New Issue
Block a user