feat: 改用SydneyClient更准确地检测token

This commit is contained in:
ikechan8370 2023-03-31 13:52:53 +08:00
parent df4ecc84ab
commit 5b62667839

View file

@ -3,6 +3,7 @@ import { Config } from '../utils/config.js'
import { BingAIClient } from '@waylaidwanderer/chatgpt-api'
import { exec } from 'child_process'
import { checkPnpm, formatDuration, parseDuration } from '../utils/common.js'
import SydneyAIClient from "../utils/SydneyAIClient.js";
export class ChatgptManagement extends plugin {
constructor (e) {
@ -176,7 +177,7 @@ export class ChatgptManagement extends plugin {
if (token?.indexOf('=') > -1) {
cookie = token
}
const bingAIClient = new BingAIClient({
const bingAIClient = new SydneyAIClient({
userToken: token, // "_U" cookie from bing.com
cookie,
debug: Config.debug