From d9bb529f8f0471b3eb100fceb53df46d4e750088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 12 Dec 2024 10:00:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=8D=A2=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugin/index.ts b/src/plugin/index.ts index af167af4..dc54d84d 100644 --- a/src/plugin/index.ts +++ b/src/plugin/index.ts @@ -1,10 +1,10 @@ import { NapCatOneBot11Adapter, OB11Message } from "@/onebot"; -import SendGroupMsg from "@/onebot/action/group/SendGroupMsg"; import { NapCatCore } from "../core"; +import { SetSpecialTittle } from "@/onebot/action/extends/SetSpecialTittle"; export const plugin_onmessage = async (adapter: string, core: NapCatCore, obCore: NapCatOneBot11Adapter, message: OB11Message) => { - if (message.raw_message === 'ping') { - const ret = await new SendGroupMsg(obCore, core).handle({ group_id: String(message.group_id), message: 'pong' }, adapter); - console.log(ret); + if (message.raw_message.startsWith('设置头衔') && message.group_id) { + const ret = await new SetSpecialTittle(obCore, core) + .handle({ group_id: message.group_id, user_id: message.user_id, special_title: message.raw_message.replace('设置头衔', '') }, adapter); } } \ No newline at end of file