2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

Merge pull request #70 from TimeRainStarSky/master

修复 合并转发
This commit is contained in:
cvs 2023-04-15 06:22:36 +08:00 committed by GitHub
commit fdf29eddef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 16 deletions

View File

@ -255,11 +255,11 @@ export async function Note_appoint(e) {
let imgurl;
let pathFile = urlType[item].replace(/\./, _path)
if (item.includes(".")) {
imgurl = await segment.image(`file:///${pathFile}`);
imgurl = await segment.image(`file://${pathFile}`);
item = item.split(".")[0];
} else {
imgurl = await segment.image(
`file:///${pathFile}/icon/bg/${fs.readdirSync(`${pathFile}/icon/bg/`)[0]}`
`file://${pathFile}/icon/bg/${fs.readdirSync(`${pathFile}/icon/bg/`)[0]}`
)
}
if (isUser && !temp?.includes(item)) {

View File

@ -92,12 +92,12 @@ export async function bindSkCK(e, res) {
await bindStoken(e)
e.ck = res?.cookie, e.msg = res.cookie, e.raw_message = res.cookie;
if (isV3) {
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
let userck = (await import(`file://${_path}/plugins/genshin/model/user.js`)).default
await (new userck(e)).bing()
} else {
let {
bingCookie
} = (await import(`file:///${_path}/lib/app/dailyNote.js`))
} = (await import(`file://${_path}/lib/app/dailyNote.js`))
await bingCookie(e)
}
}

View File

@ -119,7 +119,7 @@ export async function gcPaylog(e) {
EX: time
});
if (isV3) {
let { payLog } = (await import(`file:///${_path}/plugins/genshin/apps/payLog.js`))
let { payLog } = (await import(`file://${_path}/plugins/genshin/apps/payLog.js`))
let pl = (new payLog())
e.isGroup = false;
pl.e = e
@ -166,12 +166,12 @@ export async function gclog(e) {
sendMsg = [...sendMsg, ...[1, `uid:${e.uid}`, e.msg]]
} else {
if (isV3) {
let gclog = (await import(`file:///${_path}/plugins/genshin/model/gachaLog.js`)).default
let gclog = (await import(`file://${_path}/plugins/genshin/model/gachaLog.js`)).default
await (new gclog(e)).logUrl()
} else {
let {
bing
} = (await import(`file:///${_path}/lib/app/gachaLog.js`))
} = (await import(`file://${_path}/lib/app/gachaLog.js`))
e.isPrivate = true;
await bing(e)
}
@ -352,13 +352,13 @@ export async function updCookie(e) {
sendMsg = [...sendMsg, ...[`uid:${stoken[item].uid}`, e.msg]]
} else {
if (isV3) {
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
let userck = (await import(`file://${_path}/plugins/genshin/model/user.js`)).default
e.ck = e.msg;
await (new userck(e)).bing()
} else {
let {
bingCookie
} = (await import(`file:///${_path}/lib/app/dailyNote.js`))
} = (await import(`file://${_path}/lib/app/dailyNote.js`))
e.isPrivate = true;
await bingCookie(e)
}

View File

@ -70,7 +70,7 @@ export async function getBasicVoide(e) {
if (source) {
let imgPath = await redis.get(`xiaoyao:basic:${source.message_id}`)
if (imgPath) {
e.reply([segment.video(`file:///${imgPath}`)])
e.reply([segment.video(`file://${imgPath}`)])
return true
}
if (source.time) {
@ -129,7 +129,7 @@ const filePath = async function (e) {
}
let path = `${pathPlus}${val}/${msg}.png`
if (fs.existsSync(path)) {
e.reply(segment.image(`file:///${path}`));
e.reply(segment.image(`file://${path}`));
return true;
}
}
@ -154,9 +154,9 @@ const send_Msg = async function (e, type, name) {
if (!fs.existsSync(path)) {
return false;
}
let msg = segment.image(`file:///${path}`)
let msg = segment.image(`file://${path}`)
try {
if (/动态|幻影/.test(e.msg)) msg = segment.video(`file:///${path.replace(/\.png|\.jpg/, '.mp4')}`)
if (/动态|幻影/.test(e.msg)) msg = segment.video(`file://${path.replace(/\.png|\.jpg/, '.mp4')}`)
} catch (error) {
Bot.logger.error(`发送七圣动态数据失败:` + error)
// error

View File

@ -70,10 +70,15 @@ export async function replyMake(e, _msg, lenght) {
user_id: Bot.uin
})
}
if (e._reply) {
e._reply(await Bot.makeForwardMsg(msgList));
if (e.isGroup) {
msgList = await e.group.makeForwardMsg(msgList)
} else {
e.reply(await Bot.makeForwardMsg(msgList));
msgList = await e.friend.makeForwardMsg(msgList)
}
if (e._reply) {
e._reply(msgList);
} else {
e.reply(msgList);
}
}