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