[频道支持] 无关紧要的修改 (#33)

* 频道支持#1
This commit is contained in:
2y8e9h22 2023-03-18 11:44:33 +08:00 committed by GitHub
parent f2b448c550
commit 930678c7d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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) {