mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
feat: 改用SydneyClient更准确地检测token
This commit is contained in:
parent
df4ecc84ab
commit
5b62667839
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import { Config } from '../utils/config.js'
|
||||||
import { BingAIClient } from '@waylaidwanderer/chatgpt-api'
|
import { BingAIClient } from '@waylaidwanderer/chatgpt-api'
|
||||||
import { exec } from 'child_process'
|
import { exec } from 'child_process'
|
||||||
import { checkPnpm, formatDuration, parseDuration } from '../utils/common.js'
|
import { checkPnpm, formatDuration, parseDuration } from '../utils/common.js'
|
||||||
|
import SydneyAIClient from "../utils/SydneyAIClient.js";
|
||||||
|
|
||||||
export class ChatgptManagement extends plugin {
|
export class ChatgptManagement extends plugin {
|
||||||
constructor (e) {
|
constructor (e) {
|
||||||
|
|
@ -176,7 +177,7 @@ export class ChatgptManagement extends plugin {
|
||||||
if (token?.indexOf('=') > -1) {
|
if (token?.indexOf('=') > -1) {
|
||||||
cookie = token
|
cookie = token
|
||||||
}
|
}
|
||||||
const bingAIClient = new BingAIClient({
|
const bingAIClient = new SydneyAIClient({
|
||||||
userToken: token, // "_U" cookie from bing.com
|
userToken: token, // "_U" cookie from bing.com
|
||||||
cookie,
|
cookie,
|
||||||
debug: Config.debug
|
debug: Config.debug
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue