Skip to content

Commit

Permalink
Merge branch 'wip2.7' of github.com:ikechan8370/chatgpt-plugin into w…
Browse files Browse the repository at this point in the history
…ip2.7
  • Loading branch information
ikechan8370 committed Jun 24, 2023
2 parents 4df97c7 + 7f799b6 commit 0279171
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 183 deletions.
4 changes: 2 additions & 2 deletions apps/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,12 @@ export class chatgpt extends plugin {
}
// 黑白名单过滤对话
let [whitelist, blacklist] = processList(Config.whitelist, Config.blacklist)
if (whitelist.length > 0) {
if (whitelist.join('').length > 0) {
if (e.isGroup && !whitelist.includes(e.group_id.toString())) return false
const list = whitelist.filter(elem => elem.startsWith('^')).map(elem => elem.slice(1))
if (!list.includes(e.sender.user_id.toString())) return false
}
if (blacklist.length > 0) {
if (blacklist.join('').length > 0) {
if (e.isGroup && blacklist.includes(e.group_id.toString())) return false
const list = blacklist.filter(elem => elem.startsWith('^')).map(elem => elem.slice(1))
if (list.includes(e.sender.user_id.toString())) return false
Expand Down
4 changes: 2 additions & 2 deletions apps/entertainment.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ ${translateLangLabels}

const regExp = /词云(\d{0,2})(|h)/
const match = e.msg.trim().match(regExp)
const duration = !match[1] ? 12 : parseInt(match[1]) // default 12h
const duration = !match[1] ? 12 : parseInt(match[1]) // default 12h

if (duration > 24) {
if(duration > 24) {
await e.reply('最多只能统计24小时内的记录哦')
return false
}
Expand Down
6 changes: 2 additions & 4 deletions apps/management.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务,
roleList = getVoicevoxRoleList()
break
case 'azure':
if (matchCommand[2] === 'azure') {
roleList = getAzureRoleList()
}
roleList = getAzureRoleList()
break
default:
break
Expand Down Expand Up @@ -1458,7 +1456,7 @@ Poe 模式会调用 Poe 中的 Claude-instant 进行对话。需要提供 Cookie
})
await redis.set('CHATGPT:USE', redisConfig.useMode)
}
await this.reply(await makeForwardMsg(this.e, changeConfig.map(msg => `修改项:${msg.item}\n旧数据\n\n${msg.url}\n\n新数据\n ${msg.url}`)))
await this.reply(await makeForwardMsg(this.e, changeConfig.map(msg => `修改项:${msg.item}\n旧数据\n\n${msg.old}\n\n新数据\n ${msg.value}`)))
} catch (error) {
console.error(error)
await e.reply('配置文件错误')
Expand Down
2 changes: 1 addition & 1 deletion guoba.support.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ export function supportGuoba () {
setConfigData (data, { Result }) {
for (let [keyPath, value] of Object.entries(data)) {
// 处理黑名单
if (keyPath === 'blockWords' || keyPath === 'promptBlockWords' || keyPath === 'initiativeChatGroups') { value = value.toString().split(/[,,;;\|]/) }
if (keyPath === 'blacklist' || keyPath === 'whitelist' || keyPath === 'blockWords' || keyPath === 'promptBlockWords' || keyPath === 'initiativeChatGroups') { value = value.toString().split(/[,,;;\|]/) }
if (Config[keyPath] !== value) { Config[keyPath] = value }
}
// 正确储存azureRoleSelect结果
Expand Down
Loading

0 comments on commit 0279171

Please sign in to comment.