Merge pull request #2 from ikechan8370/v2

up
This commit is contained in:
ycxom 2025-01-30 13:12:28 +08:00 committed by GitHub
commit 690eac4a6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 93 additions and 144 deletions

View file

@ -794,7 +794,7 @@ export class chatgpt extends plugin {
if (lyrics !== '') {
sunoList.push(
{
json: { option: 'Suno', tags: client.generateRandomStyle(), title: `${e.sender.nickname}之歌`, lyrics: lyrics },
json: { option: 'Suno', tags: client.generateRandomStyle(), title: `${e.sender.nickname}之歌`, lyrics },
markdown: null,
origin: lyrics
}
@ -823,11 +823,12 @@ export class chatgpt extends plugin {
}
}
let response = chatMessage?.text?.replace('\n\n\n', '\n')
let thinking = chatMessage.thinking_text
if (handler.has('chatgpt.response.post')) {
logger.debug('调用后处理器: chatgpt.response.post')
handler.call('chatgpt.response.post', this.e, {
content: response,
thinking,
use,
prompt
}, true).catch(err => {
@ -1042,6 +1043,10 @@ export class chatgpt extends plugin {
suggested: chatMessage.suggestedResponses
}
})
if (thinking) {
let thinkingForward = await common.makeForwardMsg(e, [thinking], '思考过程')
this.reply(thinkingForward)
}
if (Config.enableSuggestedResponses && chatMessage.suggestedResponses) {
this.reply(`建议的回复:\n${chatMessage.suggestedResponses}`)
}

View file

@ -244,7 +244,7 @@ export class help extends plugin {
async removeSharePrompt (e) {
let master = (await getMasterQQ())[0]
let name = e.msg.replace(/^#(chatgpt|ChatGPT)(删除|取消|撤销)共享设定/, '')
let response = await fetch(`https://chatgpt.roki.best/prompt?name=${name}&qq=${master || (getUin(e) + '')}`, {
let response = await fetch(`https://prompt.ikechan8370.com/prompt?name=${name}&qq=${master || (getUin(e) + '')}`, {
method: 'DELETE',
headers: {
'FROM-CHATGPT': 'ikechan8370'
@ -363,7 +363,7 @@ export class help extends plugin {
examples
}
logger.info(toUploadBody)
let response = await fetch('https://chatgpt.roki.best/prompt', {
let response = await fetch('https://prompt.ikechan8370.com/prompt', {
method: 'POST',
body: JSON.stringify(toUploadBody),
headers: {
@ -387,7 +387,7 @@ export class help extends plugin {
async detailCloudPrompt (e) {
let name = e.msg.replace(/^#(chatgpt|ChatGPT)(在线)?预览设定详情/, '')
let response = await fetch('https://chatgpt.roki.best/prompt?name=' + name, {
let response = await fetch('https://prompt.ikechan8370.com/prompt?name=' + name, {
method: 'GET',
headers: {
'FROM-CHATGPT': 'ikechan8370'
@ -414,7 +414,7 @@ export class help extends plugin {
search = split[0]
page = parseInt(split[1])
}
let response = await fetch('https://chatgpt.roki.best/prompt/list?search=' + search + `&page=${page - 1}`, {
let response = await fetch('https://prompt.ikechan8370.com/prompt/list?search=' + search + `&page=${page - 1}`, {
method: 'GET',
headers: {
'FROM-CHATGPT': 'ikechan8370'
@ -442,7 +442,7 @@ export class help extends plugin {
await e.reply('设定名字呢?', true)
return true
}
let response = await fetch('https://chatgpt.roki.best/prompt?name=' + promptName, {
let response = await fetch('https://prompt.ikechan8370.com/prompt?name=' + promptName, {
method: 'GET',
headers: {
'FROM-CHATGPT': 'ikechan8370'