parent
f2b448c550
commit
930678c7d0
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { pipeline } from 'stream'
|
||||
import { promisify } from 'util'
|
||||
import fetch from 'node-fetch'
|
||||
|
@ -67,11 +66,16 @@ function mkdirs (dirname) {
|
|||
* @param dec 转发描述
|
||||
*/
|
||||
async function makeForwardMsg (e, msg = [], dec = '') {
|
||||
// 是频道直接返回 join
|
||||
if (e.isGuild) return msg.join("\n")
|
||||
|
||||
let nickname = Bot.nickname
|
||||
|
||||
if (e.isGroup) {
|
||||
let info = await Bot.getGroupMemberInfo(e.group_id, Bot.uin)
|
||||
nickname = info.card || info.nickname
|
||||
}
|
||||
|
||||
let userInfo = {
|
||||
user_id: Bot.uin,
|
||||
nickname
|
||||
|
|
|
@ -53,9 +53,7 @@ class PluginsLoader {
|
|||
if (tmp.apps) tmp = { ...tmp.apps }
|
||||
let isAdd = false
|
||||
lodash.forEach(tmp, (p, i) => {
|
||||
if (!p.prototype) {
|
||||
return
|
||||
}
|
||||
if (!p.prototype) return
|
||||
isAdd = true
|
||||
/* eslint-disable new-cap */
|
||||
let plugin = new p()
|
||||
|
@ -71,7 +69,6 @@ class PluginsLoader {
|
|||
priority: plugin.priority
|
||||
})
|
||||
})
|
||||
|
||||
if (isAdd) pluCount++
|
||||
} catch (error) {
|
||||
if (error.stack.includes('Cannot find package')) {
|
||||
|
@ -148,7 +145,6 @@ class PluginsLoader {
|
|||
/** 监听热更新 */
|
||||
this.watch(val.name, app.name)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -508,7 +504,8 @@ class PluginsLoader {
|
|||
logger.error(err)
|
||||
}
|
||||
|
||||
if (recallMsg > 0 && msgRes?.message_id) {
|
||||
// 频道一下是不是频道
|
||||
if (!e.isGuild && recallMsg > 0 && msgRes?.message_id) {
|
||||
if (e.isGroup) {
|
||||
setTimeout(() => e.group.recallMsg(msgRes.message_id), recallMsg * 1000)
|
||||
} else if (e.friend) {
|
||||
|
|
Loading…
Reference in New Issue