forked from Nwflower/auto-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
32 lines (28 loc) · 851 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import fs from 'node:fs'
import setting from './model/setting.js'
logger.info('---------!_!---------')
logger.info('自动化插件1.0.5载入成功')
const files = fs
.readdirSync('./plugins/auto-plugin/app')
.filter((file) => file.endsWith('.js'))
let apps = {}
for (let file of files) {
let name = file.replace('.js', '')
apps[name] = (await import(`./app/${file}`))[name]
}
setTimeout(async function () {
// 群名片复位
let GroupNameConfig = setting.getConfig('autoGroupName')
if (GroupNameConfig.enable) {
Bot.gl.forEach((v, k) => {
try {
Bot.pickGroup(k).setCard(Bot.uin, Bot.nickname)
} catch (e) {
logger.info('【自动化插件】未能完成群名片复位,建议手动完成')
}
})
}
}, 1000)
let index = { auto: {} }
export const auto = index.auto || {}
export { apps }