2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +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 imgurl;
let pathFile = urlType[item].replace(/\./, _path) let pathFile = urlType[item].replace(/\./, _path)
if (item.includes(".")) { if (item.includes(".")) {
imgurl = await segment.image(`file:///${pathFile}`); imgurl = await segment.image(`file://${pathFile}`);
item = item.split(".")[0]; item = item.split(".")[0];
} else { } else {
imgurl = await segment.image( 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)) { if (isUser && !temp?.includes(item)) {

View File

@ -92,12 +92,12 @@ export async function bindSkCK(e, res) {
await bindStoken(e) await bindStoken(e)
e.ck = res?.cookie, e.msg = res.cookie, e.raw_message = res.cookie; e.ck = res?.cookie, e.msg = res.cookie, e.raw_message = res.cookie;
if (isV3) { 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() await (new userck(e)).bing()
} else { } else {
let { let {
bingCookie bingCookie
} = (await import(`file:///${_path}/lib/app/dailyNote.js`)) } = (await import(`file://${_path}/lib/app/dailyNote.js`))
await bingCookie(e) await bingCookie(e)
} }
} }

View File

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

View File

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

View File

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