mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
Merge branch 'v2' of github.com:ikechan8370/chatgpt-plugin into v2
This commit is contained in:
commit
b6218a26ed
4 changed files with 8 additions and 7 deletions
|
|
@ -21,7 +21,6 @@ import { OfficialChatGPTClient } from '../utils/message.js'
|
||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch'
|
||||||
import { deleteConversation, getConversations, getLatestMessageIdByConversationId } from '../utils/conversation.js'
|
import { deleteConversation, getConversations, getLatestMessageIdByConversationId } from '../utils/conversation.js'
|
||||||
import { convertSpeaker, generateAudio, speakers } from '../utils/tts.js'
|
import { convertSpeaker, generateAudio, speakers } from '../utils/tts.js'
|
||||||
import { segment } from 'oicq'
|
|
||||||
import ChatGLMClient from '../utils/chatglm.js'
|
import ChatGLMClient from '../utils/chatglm.js'
|
||||||
try {
|
try {
|
||||||
await import('keyv')
|
await import('keyv')
|
||||||
|
|
@ -68,7 +67,6 @@ export class chatgpt extends plugin {
|
||||||
name: 'chatgpt',
|
name: 'chatgpt',
|
||||||
/** 功能描述 */
|
/** 功能描述 */
|
||||||
dsc: 'chatgpt from openai',
|
dsc: 'chatgpt from openai',
|
||||||
/** https://oicqjs.github.io/oicq/#events */
|
|
||||||
event: 'message',
|
event: 'message',
|
||||||
/** 优先级,数字越小等级越高 */
|
/** 优先级,数字越小等级越高 */
|
||||||
priority: 1144,
|
priority: 1144,
|
||||||
|
|
@ -76,7 +74,8 @@ export class chatgpt extends plugin {
|
||||||
{
|
{
|
||||||
/** 学习群友聊天 **/
|
/** 学习群友聊天 **/
|
||||||
reg: '^[^#][sS]*',
|
reg: '^[^#][sS]*',
|
||||||
fnc: 'recordChat'
|
fnc: 'recordChat',
|
||||||
|
log: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
/** 命令正则匹配 */
|
/** 命令正则匹配 */
|
||||||
|
|
@ -106,7 +105,8 @@ export class chatgpt extends plugin {
|
||||||
/** 命令正则匹配 */
|
/** 命令正则匹配 */
|
||||||
reg: toggleMode === 'at' ? '^[^#][sS]*' : '^#chat[^gpt][sS]*',
|
reg: toggleMode === 'at' ? '^[^#][sS]*' : '^#chat[^gpt][sS]*',
|
||||||
/** 执行方法 */
|
/** 执行方法 */
|
||||||
fnc: 'chatgpt'
|
fnc: 'chatgpt',
|
||||||
|
log: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: '^#(chatgpt)?对话列表$',
|
reg: '^#(chatgpt)?对话列表$',
|
||||||
|
|
@ -492,7 +492,6 @@ export class chatgpt extends plugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* #chatgpt
|
* #chatgpt
|
||||||
* @param e oicq传递的事件参数e
|
|
||||||
*/
|
*/
|
||||||
async chatgpt (e) {
|
async chatgpt (e) {
|
||||||
let prompt
|
let prompt
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import plugin from '../../../lib/plugins/plugin.js'
|
import plugin from '../../../lib/plugins/plugin.js'
|
||||||
import { segment } from 'oicq'
|
|
||||||
import { createImage, editImage, imageVariation } from '../utils/dalle.js'
|
import { createImage, editImage, imageVariation } from '../utils/dalle.js'
|
||||||
import { makeForwardMsg } from '../utils/common.js'
|
import { makeForwardMsg } from '../utils/common.js'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import plugin from '../../../lib/plugins/plugin.js'
|
import plugin from '../../../lib/plugins/plugin.js'
|
||||||
import { Config } from '../utils/config.js'
|
import { Config } from '../utils/config.js'
|
||||||
import { generateHello } from '../utils/randomMessage.js'
|
import { generateHello } from '../utils/randomMessage.js'
|
||||||
import { segment } from 'oicq'
|
|
||||||
import { generateAudio } from '../utils/tts.js'
|
import { generateAudio } from '../utils/tts.js'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import { googleRequestUrl } from '../utils/emoj/index.js'
|
import { googleRequestUrl } from '../utils/emoj/index.js'
|
||||||
|
|
|
||||||
4
index.js
4
index.js
|
|
@ -1,5 +1,9 @@
|
||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import {Config} from "./utils/config.js";
|
import {Config} from "./utils/config.js";
|
||||||
|
|
||||||
|
if (!global.segment) {
|
||||||
|
global.segment = (await import("oicq")).segment
|
||||||
|
}
|
||||||
|
|
||||||
const files = fs.readdirSync('./plugins/chatgpt-plugin/apps').filter(file => file.endsWith('.js'))
|
const files = fs.readdirSync('./plugins/chatgpt-plugin/apps').filter(file => file.endsWith('.js'))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue