From dcc1a4ebd6f51311e422e95e59539fba6da9f751 Mon Sep 17 00:00:00 2001 From: misaka20002 <40714502+misaka20002@users.noreply.github.com> Date: Fri, 7 Feb 2025 22:14:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=AA=E4=BA=BA=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E7=BE=A4=20(#758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bym.js | 6 ++++++ guoba.support.js | 15 +++++++++++++-- utils/config.js | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/bym.js b/apps/bym.js index 12243a9..25f2cdc 100644 --- a/apps/bym.js +++ b/apps/bym.js @@ -28,6 +28,12 @@ export class bym extends plugin { if (!Config.enableBYM) { return false } + + // 伪人禁用群 + if (Config.bymDisableGroup?.includes(e.group_id?.toString())) { + return false + } + let sender = e.sender.user_id let card = e.sender.card || e.sender.nickname let group = e.group_id diff --git a/guoba.support.js b/guoba.support.js index fdf6b95..c255ab0 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -54,7 +54,7 @@ export function supportGuoba () { { field: 'enableBYM', label: '开启伪人模式', - bottomHelpMessage: '开启后,将在群内随机发言,伪装成人。取消机器人前缀体验最佳。目前仅支持gemini,会使用gemini的配置。发言包括AI名字会必定触发回复。暂不支持分群管理,可在不同群禁用或启动“ChatGPT-Plugin 伪人bym”功能', + bottomHelpMessage: '开启后,将在群内随机发言,伪装成人。取消机器人前缀体验最佳。目前仅支持gemini,会使用gemini的配置。发言包括AI名字会必定触发回复。', component: 'Switch' }, { @@ -918,7 +918,6 @@ export function supportGuoba () { label: '合成emoji的API地址,默认谷歌厨房', component: 'Input' }, - { field: 'bymRate', label: '伪人模式触发概率,单位为%', @@ -928,6 +927,18 @@ export function supportGuoba () { max: 100 } }, + { + field: 'bymDisableGroup', + label: '伪人禁用群', + bottomHelpMessage: '设置在该群禁用伪人模式', + component: "GTags", + componentProps: { + placeholder: '请输入群号', + allowAdd: true, + allowDel: true, + valueParser: ((value) => value.split(',') || []), + }, + }, { field: 'bymMode', label: '伪人模型', diff --git a/utils/config.js b/utils/config.js index 1e447e1..44e23ce 100644 --- a/utils/config.js +++ b/utils/config.js @@ -199,6 +199,7 @@ const defaultConfig = { enableBYM: false, // 触发对话的概率,百分比。比如5%就写5 bymRate: 5, + bymDisableGroup: [], // 伪人模式触发骂人反击的关键词 bymFuckList: [ '骂',