From 484086a4ba227d3ce6540d39a85e696e6f6e5af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=89=E9=A3=8E=E6=9D=A5?= Date: Mon, 15 Jul 2024 23:32:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 等风来 --- apps/events/message.js | 4 ++-- package.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/events/message.js b/apps/events/message.js index 00de856..a72412a 100644 --- a/apps/events/message.js +++ b/apps/events/message.js @@ -173,9 +173,9 @@ Bot.on?.("message", async(e) => { await common.sendMasterMsg(msg, (e.bot ?? Bot).uin) if (forwardMsg) await common.sendMasterMsg(forwardMsg, (e.bot ?? Bot).uin) }) -// 特殊消息处理 + /** - * + * 特殊消息处理 * @param msg */ function getMsgType(msg) { diff --git a/package.json b/package.json index ca28c25..f955b7a 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,11 @@ "eslint": "^8.57.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsdoc": "^48.2.9", - "eslint-plugin-promise": "^6.2.0", - "gitmoji-cli": "^9.2.0", + "eslint-plugin-jsdoc": "^48.7.0", + "eslint-plugin-promise": "^6.4.0", + "gitmoji-cli": "^9.4.0", "husky": "^9.0.11", - "lint-staged": "^15.2.6" + "lint-staged": "^15.2.7" }, "optionalDependencies": { "abort-controller": "^3.0.0" From 8989c3a955bad3f0c6932202bbf3588c46fc7fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=89=E9=A3=8E=E6=9D=A5?= Date: Sun, 21 Jul 2024 21:51:26 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=99=88=20=E7=BB=86=E8=8A=82=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5a0ebad..8ceaba3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ test.* *.log .vscode/ temp/ -*.css.map \ No newline at end of file +*.css.map +pnpm-lock.yaml \ No newline at end of file From 162cf4cabb1fd0763034222c37908e93cd4bbcbd Mon Sep 17 00:00:00 2001 From: Admilk Date: Sun, 21 Jul 2024 14:00:35 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AF=B9=E8=AE=BE=E7=BD=AE=E7=AE=A1=E7=90=86=E7=BE=A4=E5=91=98?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=9C=A8=E7=BE=A4=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/groupAdmin/groupAdmin.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/groupAdmin/groupAdmin.js b/apps/groupAdmin/groupAdmin.js index ad58795..927043a 100644 --- a/apps/groupAdmin/groupAdmin.js +++ b/apps/groupAdmin/groupAdmin.js @@ -168,14 +168,16 @@ export class GroupAdmin extends plugin { let qq = e.message.find(item => item.type == "at")?.qq const type = /设置管理/.test(e.msg) if (!qq) qq = e.msg.replace(/#|(设置|取消)管理/g, "").trim() - if (!qq || !(/\d{5,}/.test(qq))) return e.reply("❎ 请输入正确的QQ号") - const Member = e.group.pickMember(Number(qq) || qq) + let Member; + try { + Member = e.group.pickMember(Number(qq) || qq, true) + } catch { + return e.reply("❎ 这个群没有这个人哦~") + } const Memberinfo = Member?.info || await Member?.getInfo?.() - if (!Memberinfo) return e.reply("❎ 这个群没有这个人哦~") - const res = await e.group.setAdmin(qq, type) - const name = Memberinfo.card || Memberinfo.nickname + const name = Memberinfo.card || Memberinfo.nickname || (Number(qq) || qq) if (!res) return e.reply("❎ 未知错误") type ? e.reply(`✅ 已经把「${name}」设置为管理啦!!`) : e.reply(`✅ 已取消「${name}」的管理`) } From 3c790d39087aa80dfd42254c3ddbabb69d86809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=89=E9=A3=8E=E6=9D=A5?= Date: Sun, 21 Jul 2024 22:03:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A8=20=E7=BB=86=E8=8A=82=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 711acad..11b6596 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,7 @@ #!/bin/sh -echo -e "\e[1;33m-----------代码正在ESLint格式化-----------\e[0m" +echo "-----------代码正在ESLint格式化-----------" pnpm run lint -echo -e "\e[1;32m-------------代码格式化完成---------------\e[0m" \ No newline at end of file +echo "-------------代码格式化完成---------------" \ No newline at end of file From b78bd5b2abee4409749f8f31682a353cbe84f8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Thu, 1 Aug 2024 09:42:35 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/thumbUp.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/thumbUp.js b/apps/thumbUp.js index 1fa209a..407f6dd 100644 --- a/apps/thumbUp.js +++ b/apps/thumbUp.js @@ -2,6 +2,10 @@ import { funApi, common, memes } from "../model/index.js" import _ from "lodash" import { Config } from "../components/index.js" +Bot.on("message.group", e => { + if (e?.message?.[0]?.text == "#全部赞我") { (new ThumbUp()).thumbUp(e) } +}) + export class ThumbUp extends plugin { constructor(e) { super({ @@ -15,7 +19,6 @@ export class ThumbUp extends plugin { } ] }) - if (e?.message?.[0]?.text == "#全部赞我") { this.thumbUp(e) } } /** @@ -23,6 +26,7 @@ export class ThumbUp extends plugin { * @param e */ async thumbUp(e) { + const message = e.msg || e.message?.[0]?.text const DO_ZAN = "赞" const DO_CHAO = "超" let doType = DO_ZAN @@ -31,12 +35,12 @@ export class ThumbUp extends plugin { // 使用数组和includes方法的正确用法 const forbiddenWords = [ "超", "操", "草", "抄", "吵", "炒" ] - if (forbiddenWords.some(word => e.msg.includes(word))) { + if (forbiddenWords.some(word => message.includes(word))) { doType = DO_CHAO } const atWords = [ "他", "她", "它", "TA", "ta", "Ta" ] - if (e.at && atWords.some(word => e.msg.includes(word))) { + if (e.at && atWords.some(word => message.includes(word))) { userId = e.at isSelf = false } @@ -44,7 +48,7 @@ export class ThumbUp extends plugin { let isFriend = await (e.bot ?? Bot).fl.get(userId) let allowLikeByStrangers = Config.whole.Strangers_love if (!isFriend && !allowLikeByStrangers) { - return (e.message?.[0]?.text == "#全部赞我") ? false : e.reply(`不加好友不${doType}🙄`, true) + return (message == "#全部赞我") ? false : e.reply(`不加好友不${doType}🙄`, true) } /** 执行点赞 */ @@ -80,7 +84,7 @@ export class ThumbUp extends plugin { const successFn = _.sample([ "ganyu", "zan" ]) const mention = segment.at(userId) - if (e.message?.[0]?.text == "#全部赞我")failsMsg = "return" + if (message == "#全部赞我")failsMsg = "return" /** 判断点赞是否成功 */ let msg = await generateResponseMsg(n > 0, successMsg, failsMsg, avatar, successFn, mention) From 44b38e1c2f6528b40f77f9c4616efeae7de9e500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=89=E9=A3=8E=E6=9D=A5?= Date: Fri, 2 Aug 2024 00:14:52 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/‮ | Bin 83 -> 102 bytes package.json | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/‮ b/.github/ISSUE_TEMPLATE/‮ index cb9adcb1a7262d19e06348a936798548aa1f062a..ca48fde15c2dee5ca54afded07677f93bc7a71e5 100644 GIT binary patch delta 33 pcmWGeWBJeT$U2e5M=XX*K=S_o9oKohE(9*@3%%MCSE|Cm3INE~3|#;K delta 14 VcmYcbX8F(W$TE?|hgpSz1ppod104VW diff --git a/package.json b/package.json index f955b7a..4c58094 100644 --- a/package.json +++ b/package.json @@ -25,17 +25,17 @@ "colorthief": "^2.4.0", "jimp": "^0.22.12", "node-fetch": "^3.3.2", - "systeminformation": "^5.22.11" + "systeminformation": "^5.23.2" }, "devDependencies": { "all-contributors-cli": "^6.26.1", "eslint": "^8.57.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsdoc": "^48.7.0", - "eslint-plugin-promise": "^6.4.0", + "eslint-plugin-jsdoc": "^48.10.2", + "eslint-plugin-promise": "^6.6.0", "gitmoji-cli": "^9.4.0", - "husky": "^9.0.11", + "husky": "^9.1.4", "lint-staged": "^15.2.7" }, "optionalDependencies": {