mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-22 06:58:24 +00:00
perf: 引用原图逻辑判断
This commit is contained in:
parent
a3f8894129
commit
92875b5f31
@ -15,16 +15,16 @@ export async function getOriginalPicture (e) {
|
|||||||
if (e.source.user_id !== e.self_id) {
|
if (e.source.user_id !== e.self_id) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 引用的消息不是纯图片
|
|
||||||
if (!/^\[图片]$/.test(e.source.message)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 获取原消息
|
// 获取原消息
|
||||||
if (e.group?.getChatHistory) {
|
if (e.group?.getChatHistory) {
|
||||||
source = (await e.group.getChatHistory(e.source.seq, 1)).pop()
|
source = (await e.group.getChatHistory(e.source.seq, 1)).pop()
|
||||||
} else if (e.friend?.getChatHistory) {
|
} else if (e.friend?.getChatHistory) {
|
||||||
source = (await e.friend.getChatHistory(e.source.time, 1)).pop()
|
source = (await e.friend.getChatHistory(e.source.time, 1)).pop()
|
||||||
}
|
}
|
||||||
|
// 引用的不是纯图片
|
||||||
|
if (!(source?.message?.length === 1 && source?.message[0]?.type === 'image')) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let originalPic = Cfg.get('originalPic') * 1
|
let originalPic = Cfg.get('originalPic') * 1
|
||||||
if (source) {
|
if (source) {
|
||||||
|
Loading…
Reference in New Issue
Block a user