🧑💻
This commit is contained in:
@@ -3,12 +3,12 @@ module.exports = {
|
||||
es2021: true,
|
||||
node: true
|
||||
},
|
||||
extends: ['standard', 'plugin:jsdoc/recommended'],
|
||||
extends: ['standard', 'plugin:jsdoc/recommended', 'plugin:import/recommended', 'plugin:promise/recommended'],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module'
|
||||
},
|
||||
plugins: ['import', 'n', 'promise', 'jsdoc'],
|
||||
plugins: ['import', 'promise', 'jsdoc'],
|
||||
globals: {
|
||||
Bot: true,
|
||||
redis: true,
|
||||
|
||||
@@ -151,7 +151,7 @@ export class Assistant extends plugin {
|
||||
}
|
||||
|
||||
await this.Bot.setAvatar(e.img[0])
|
||||
.then(() => { e.reply('✅ 头像修改成功') })
|
||||
.then(() => e.reply('✅ 头像修改成功'))
|
||||
.catch((err) => {
|
||||
e.reply('❎ 头像修改失败')
|
||||
logger.error(err)
|
||||
|
||||
@@ -243,7 +243,7 @@ export class NewHandle extends plugin {
|
||||
if (group) {
|
||||
logger.mark(`${e.logFnc}回复临时消息`)
|
||||
return (e.bot ?? Bot).sendTempMsg(group, qq, e.message)
|
||||
.then(() => { e.reply('✅ 已把消息发给它了哦~') })
|
||||
.then(() => e.reply('✅ 已把消息发给它了哦~'))
|
||||
.catch((err) => common.handleException(e, err, { MsgTemplate: '❎ 发送失败\n错误信息为:{error}' }))
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ export class NewHandle extends plugin {
|
||||
|
||||
(e.bot ?? Bot).pickFriend(qq)
|
||||
.sendMsg(e.message)
|
||||
.then(() => { e.reply('✅ 已把消息发给它了哦~') })
|
||||
.then(() => e.reply('✅ 已把消息发给它了哦~'))
|
||||
.catch((err) => common.handleException(e, err, { MsgTemplate: '❎ 发送失败\n错误信息为:{error}' }))
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,10 @@ export class NewPicSearch extends plugin {
|
||||
if (!await this._Authentication(e)) return
|
||||
if (!await this.handelImg(e, 'SauceNAO')) return
|
||||
await PicSearch.SauceNAO(e.img[0])
|
||||
.then(async res => {
|
||||
res.length == 1
|
||||
? common.recallsendMsg(e, res[0], true)
|
||||
: common.recallSendForwardMsg(e, res, { xmlTitle: false })
|
||||
})
|
||||
.then(async res => res.length == 1
|
||||
? common.recallsendMsg(e, res[0], true)
|
||||
: common.recallSendForwardMsg(e, res, { xmlTitle: false })
|
||||
)
|
||||
.catch(async err => {
|
||||
await common.handleException(e, err)
|
||||
if (Config.picSearch.useAscii2dWhenFailed) {
|
||||
@@ -67,6 +66,7 @@ export class NewPicSearch extends plugin {
|
||||
for (let i of res) {
|
||||
await e.reply(i)
|
||||
}
|
||||
return true
|
||||
})
|
||||
.catch(err => common.handleException(e, err))
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ export class NewPixiv extends plugin {
|
||||
await Pixiv.illust(regRet[1], filter)
|
||||
.then(async res => {
|
||||
await e.reply(res.msg)
|
||||
res.img.length == 1 ? common.recallsendMsg(e, res.img) : common.recallSendForwardMsg(e, res.img, false)
|
||||
return res.img.length == 1 ? common.recallsendMsg(e, res.img) : common.recallSendForwardMsg(e, res.img, false)
|
||||
})
|
||||
.catch(err => common.handleException(e, err))
|
||||
}
|
||||
@@ -221,11 +221,10 @@ export class NewPixiv extends plugin {
|
||||
if (!await this._Authentication(e, 'sese')) return
|
||||
e.reply(Pixiv.startMsg)
|
||||
let num = e.msg.match(/\d+/) || 1
|
||||
await Pixiv.illustRecommended(num).then(res => {
|
||||
res.length == 1
|
||||
? common.recallsendMsg(e, res[0], true)
|
||||
: common.recallSendForwardMsg(e, res)
|
||||
}).catch(err => common.handleException(e, err))
|
||||
await Pixiv.illustRecommended(num).then(res => res.length == 1
|
||||
? common.recallsendMsg(e, res[0], true)
|
||||
: common.recallSendForwardMsg(e, res)
|
||||
).catch(err => common.handleException(e, err))
|
||||
}
|
||||
|
||||
// 更换代理
|
||||
|
||||
@@ -44,7 +44,6 @@ export class NewState extends plugin {
|
||||
// 防止多次触发
|
||||
if (interval) { return false } else interval = true
|
||||
// 系统
|
||||
let FastFetch; let HardDisk
|
||||
let otherInfo = []
|
||||
// 其他信息
|
||||
otherInfo.push({
|
||||
@@ -56,8 +55,8 @@ export class NewState extends plugin {
|
||||
// 插件数量
|
||||
otherInfo.push(State.getPluginNum)
|
||||
let promiseTaskList = [
|
||||
State.getFastFetch(e).then(res => { FastFetch = res }),
|
||||
State.getFsSize().then(res => { HardDisk = res })
|
||||
State.getFastFetch(e),
|
||||
State.getFsSize()
|
||||
]
|
||||
|
||||
// 网络测试
|
||||
@@ -69,7 +68,7 @@ export class NewState extends plugin {
|
||||
tail: res
|
||||
}))))
|
||||
// 执行promise任务
|
||||
await Promise.all(promiseTaskList)
|
||||
let [FastFetch, HardDisk] = await Promise.all(promiseTaskList)
|
||||
// 可视化数据
|
||||
let visualData = _.compact(await Promise.all([
|
||||
// CPU板块
|
||||
|
||||
@@ -31,11 +31,13 @@
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jsdoc": "^48.2.1",
|
||||
"eslint-plugin-n": "^16.6.2",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.2.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"abort-controller": "^3.0.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint --fix"
|
||||
|
||||
Reference in New Issue
Block a user