修复 添加表情无法删除
This commit is contained in:
parent
fdd2936cec
commit
7257bd9c24
|
@ -14,8 +14,8 @@ import Runtime from "./runtime.js"
|
|||
global.plugin = plugin
|
||||
|
||||
function toSegment(type, data) {
|
||||
for (const i in data) {
|
||||
if (data[i]) {
|
||||
for (const i in data)
|
||||
if (data[i])
|
||||
switch (typeof data[i]) {
|
||||
case "string":
|
||||
if ((i == "file" || data[i].match(/^file:\/\//)) && fs.existsSync(data[i].replace(/^file:\/\//, "")))
|
||||
|
@ -25,8 +25,6 @@ function toSegment(type, data) {
|
|||
if (Buffer.isBuffer(data[i]))
|
||||
data[i] = `base64://${data[i].toString("base64")}`
|
||||
}
|
||||
}
|
||||
}
|
||||
return { type, ...data }
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,6 @@ export class add extends plugin {
|
|||
this.e.isGlobal = this.e.msg.includes("全局");
|
||||
|
||||
this.keyWord = this.e.raw_message.trim()
|
||||
/** 过滤#添加 */
|
||||
.replace(/^#?(全局)?(添加|删除)(图片|表情)?/, '')
|
||||
.trim()
|
||||
|
||||
|
@ -520,9 +519,14 @@ export class add extends plugin {
|
|||
|
||||
this.initTextArr()
|
||||
|
||||
let keyWord = this.e.toString().replace(/#|#|图片|表情|删除|全部|全局/g, '')
|
||||
this.getKeyWord()
|
||||
|
||||
keyWord = this.trimAlias(keyWord)
|
||||
if (!this.keyWord) {
|
||||
this.e.reply('删除错误:没有关键词')
|
||||
return
|
||||
}
|
||||
|
||||
let keyWord = this.trimAlias(this.keyWord)
|
||||
|
||||
let num = false
|
||||
let index = 0
|
||||
|
@ -577,7 +581,7 @@ export class add extends plugin {
|
|||
let retMsg = [{ type: 'text', text: '删除成功:' }]
|
||||
for (let msg of this.e.message) {
|
||||
if (msg.type == 'text') {
|
||||
msg.text = msg.text.replace(/#|#|图片|表情|删除|全部|全局/g, '')
|
||||
msg.text = msg.text.replace(/^#?(全局)?(添加|删除)(图片|表情)?/, '')
|
||||
|
||||
if (!msg.text) continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue