From 1bba64847974de1949fa8f440f060d073f65fe84 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 30 Sep 2024 02:25:10 +0800 Subject: [PATCH] Format `src/bots/openai/ChatGPTBot.js` (#915) Use `npm run lint`/`vue-cli-service lint` to format the code. Related to #914 / 3675a9415ab1d0e9407ae10be083d8cd4cc297eb --- src/bots/openai/ChatGPTBot.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/bots/openai/ChatGPTBot.js b/src/bots/openai/ChatGPTBot.js index a2a8ede88..5b6e52fab 100644 --- a/src/bots/openai/ChatGPTBot.js +++ b/src/bots/openai/ChatGPTBot.js @@ -41,9 +41,7 @@ export default class ChatGPTBot extends Bot { let available = false; try { - const response = await axios.get( - "https://chatgpt.com/api/auth/session", - ); + const response = await axios.get("https://chatgpt.com/api/auth/session"); if (!response.data?.error && response.data?.accessToken) { this.accessToken = response.data.accessToken; available = true; @@ -214,16 +212,13 @@ export default class ChatGPTBot extends Bot { return new Promise((resolve, reject) => { try { - const source = new SSE( - "https://chatgpt.com/backend-api/conversation", - { - headers: { - ...headers, - accept: "text/event-stream", - }, - payload, + const source = new SSE("https://chatgpt.com/backend-api/conversation", { + headers: { + ...headers, + accept: "text/event-stream", }, - ); + payload, + }); let preInfo = []; source.addEventListener("message", (event) => {