mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 对接
This commit is contained in:
parent
89ab58b3d7
commit
eee1285e2f
11 changed files with 221 additions and 26 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import ChatGPTConfig from '../config/config.js'
|
||||
import { createCRUDCommandRules, createSwitchCommandRules } from '../utils/command.js'
|
||||
import { Chaite } from '../../../../../../WebstormProjects/node-chaite/src/index.js'
|
||||
import { Chaite } from 'chaite'
|
||||
import { resolve } from 'eslint-plugin-promise/rules/lib/promise-statics.js'
|
||||
|
||||
export class ChatGPTManagement extends plugin {
|
||||
constructor () {
|
||||
|
|
@ -22,7 +23,19 @@ export class ChatGPTManagement extends plugin {
|
|||
}
|
||||
]
|
||||
})
|
||||
this.rules.push(...[
|
||||
this.initCommand(cmdPrefix)
|
||||
}
|
||||
|
||||
async initCommand (cmdPrefix) {
|
||||
const waitForChaite = async () => {
|
||||
while (!Chaite.getInstance()) {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
}
|
||||
return Chaite.getInstance()
|
||||
}
|
||||
|
||||
await waitForChaite()
|
||||
this.rule.push(...[
|
||||
...createCRUDCommandRules.bind(this)(cmdPrefix, '渠道', 'channels'),
|
||||
...createCRUDCommandRules.bind(this)(cmdPrefix, '预设', 'presets'),
|
||||
...createCRUDCommandRules.bind(this)(cmdPrefix, '工具', 'tools'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue