新增对群聊黑白名单和启禁用私聊的功能,添加对全局回复模式、语音角色和主动打招呼的指令配置。 (#341)

* feat: add support for ‘greeting’ and ‘global reply mode’ commands, improve variable naming and remove unnecessary backend output.

* feat: Add support for black and white lists, global reply mode and voice role settings, private chat switch, and active greeting configuration. Refactor some variable names and comment out redundant code for better readability and reduced backend output.

* feat: 为新功能完善了帮助面板

* docs: 完善了‘打招呼’的帮助说明

* feature:Add custom configuration for voice filtering regex.

---------

Co-authored-by: Sean <1519059137@qq.com>
This commit is contained in:
Sean Murphy 2023-04-13 22:36:58 +08:00 committed by GitHub
parent 11a62097f0
commit 4b29e261a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1190 additions and 802 deletions

View file

@ -38,12 +38,30 @@ export function supportGuoba () {
bottomHelpMessage: '检查输入结果中是否有违禁词,如果存在黑名单中的违禁词则不输出。英文逗号隔开',
component: 'InputTextArea'
},
{
field: 'groupWhitelist',
label: '群聊白名单',
bottomHelpMessage: '设置后只有白名单内的群可以使用本插件。用英文逗号隔开',
component: 'Input'
},
{
field: 'groupBlacklist',
label: '群聊黑名单',
bottomHelpMessage: '设置后名单内的群禁止使用本插件。用英文逗号隔开',
component: 'Input'
},
{},
{
field: 'imgOcr',
label: '图片识别',
bottomHelpMessage: '是否识别消息中图片的文字内容,需要同时包含图片和消息才生效',
component: 'Switch'
},
{
field: 'enablePrivateChat',
label: '是否允许私聊机器人',
component: 'Switch'
},
{
field: 'defaultUsePicture',
label: '全局图片模式',
@ -65,6 +83,12 @@ export function supportGuoba () {
options: speakers.concat('随机').map(s => { return { label: s, value: s } })
}
},
{
field: 'ttsRegex',
label: '语音过滤正则表达式',
bottomHelpMessage: '语音模式下配置此项以过滤不想被读出来的内容。表达式测试地址https://www.runoob.com/regexp/regexp-syntax.html',
component: 'Input'
},
{
field: 'ttsAutoFallbackThreshold',
label: '语音转文字阈值',
@ -303,7 +327,7 @@ export function supportGuoba () {
// component: 'InputTextArea'
// },
{
field: 'groupContextLength',
field: 'groupContextLength',
label: '允许机器人读取近期的最多群聊聊天记录条数。',
bottomHelpMessage: '允许机器人读取近期的最多群聊聊天记录条数。太多可能会超。默认50',
component: 'InputNumber'
@ -488,10 +512,29 @@ export function supportGuoba () {
},
{
field: 'helloPrompt',
label: '打招呼所说文字的引导文字',
label: '打招呼prompt',
bottomHelpMessage: '将会用这段文字询问ChatGPT由ChatGPT给出随机的打招呼文字',
component: 'Input'
},
{
field: 'helloInterval',
label: '打招呼间隔(小时)',
component: 'InputNumber',
componentProps: {
min: 1,
max: 24
}
},
{
field: 'helloProbability',
label: '打招呼的触发概率(%)',
bottomHelpMessage: '设置为100则每次经过间隔时间必定触发主动打招呼事件。',
component: 'InputNumber',
componentProps: {
min: 0,
max: 100
}
},
{
field: 'emojiBaseURL',
label: '合成emoji的API地址默认谷歌厨房',
@ -511,7 +554,7 @@ export function supportGuoba () {
field: 'serverPort',
label: '系统Api服务端口',
bottomHelpMessage: '系统Api服务开启的端口号如需外网访问请将系统防火墙和服务器防火墙对应端口开放,修改后请重启',
component: 'InputNumber',
component: 'InputNumber'
},
{
field: 'serverHost',
@ -529,14 +572,14 @@ export function supportGuoba () {
field: 'chatViewWidth',
label: '图片渲染宽度',
bottomHelpMessage: '聊天页面渲染窗口的宽度',
component: 'InputNumber',
component: 'InputNumber'
},
{
field: 'chatViewBotName',
label: 'Bot命名',
bottomHelpMessage: '新渲染模式强制修改Bot命名',
component: 'Input'
},
}
],
// 获取配置数据方法(用于前端填充显示数据)
getConfigData () {
@ -553,4 +596,4 @@ export function supportGuoba () {
}
}
}
}
}