feat: 伪人禁用群 (#758)

This commit is contained in:
misaka20002 2025-02-07 22:14:09 +08:00 committed by GitHub
parent 916e1082d7
commit dcc1a4ebd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View file

@ -28,6 +28,12 @@ export class bym extends plugin {
if (!Config.enableBYM) { if (!Config.enableBYM) {
return false return false
} }
// 伪人禁用群
if (Config.bymDisableGroup?.includes(e.group_id?.toString())) {
return false
}
let sender = e.sender.user_id let sender = e.sender.user_id
let card = e.sender.card || e.sender.nickname let card = e.sender.card || e.sender.nickname
let group = e.group_id let group = e.group_id

View file

@ -54,7 +54,7 @@ export function supportGuoba () {
{ {
field: 'enableBYM', field: 'enableBYM',
label: '开启伪人模式', label: '开启伪人模式',
bottomHelpMessage: '开启后将在群内随机发言伪装成人。取消机器人前缀体验最佳。目前仅支持gemini会使用gemini的配置。发言包括AI名字会必定触发回复。暂不支持分群管理可在不同群禁用或启动“ChatGPT-Plugin 伪人bym”功能', bottomHelpMessage: '开启后将在群内随机发言伪装成人。取消机器人前缀体验最佳。目前仅支持gemini会使用gemini的配置。发言包括AI名字会必定触发回复。',
component: 'Switch' component: 'Switch'
}, },
{ {
@ -918,7 +918,6 @@ export function supportGuoba () {
label: '合成emoji的API地址默认谷歌厨房', label: '合成emoji的API地址默认谷歌厨房',
component: 'Input' component: 'Input'
}, },
{ {
field: 'bymRate', field: 'bymRate',
label: '伪人模式触发概率,单位为%', label: '伪人模式触发概率,单位为%',
@ -928,6 +927,18 @@ export function supportGuoba () {
max: 100 max: 100
} }
}, },
{
field: 'bymDisableGroup',
label: '伪人禁用群',
bottomHelpMessage: '设置在该群禁用伪人模式',
component: "GTags",
componentProps: {
placeholder: '请输入群号',
allowAdd: true,
allowDel: true,
valueParser: ((value) => value.split(',') || []),
},
},
{ {
field: 'bymMode', field: 'bymMode',
label: '伪人模型', label: '伪人模型',

View file

@ -199,6 +199,7 @@ const defaultConfig = {
enableBYM: false, enableBYM: false,
// 触发对话的概率百分比。比如5%就写5 // 触发对话的概率百分比。比如5%就写5
bymRate: 5, bymRate: 5,
bymDisableGroup: [],
// 伪人模式触发骂人反击的关键词 // 伪人模式触发骂人反击的关键词
bymFuckList: [ bymFuckList: [
'骂', '骂',