Quora의 POE 용 리버스 엔지니어링 Node.js 클라이언트.
지원 : 필요한 정보를 가져 와서 .env 파일에 쓰기 | 다른 봇에 메시지를 보내십시오 | 프록시 설정 | 지우기/삭제/퍼지 메시지 | 역사 메시지 받기 | 봇 정보 받기 | 다음 데이터를 얻으십시오
나는 아직도 이것을 연구하고 있으므로 안정적이지 않을 수도 있습니다. 문제가 해결되면 문제를 만드십시오.
npm install poe-node-api요구 사항:
- 노드> = 18
- .env :
poe-formkey/cookie/buildId/ Botid와 같은 필요한 매개 변수를 저장하려면 .....
poe.com에서 쿠키 받기 : f12/검사, 응용 프로그램> 쿠키> https://poe.com> pb
프로젝트 루트 경로에서 .env 파일을 작성하고 .env 파일에 쿠키를 추가하십시오.
cookie = p-b=xxxxxxxxxxxxxxxxxxxxxxxxxxx const client = new PoeClient ( { logLevel : 'debug' } ) ;
await client . init ( )
// If no poe-formkey and buildId in .env file, client will download needed params, next time will not need to fetch these params again until cookie is changed/logout(For now).클라이언트를 만드는 방법 :
import { PoeClient } from "poe-node-api" ;
const client = new PoeClient ( { logLevel : 'debug' } ) ;클라이언트를 시작하는 방법
await client . init ( )buildId / poe-formkey 와 같은 필요한 매개 변수를 검색하고 로컬 '.env'파일에 덮어 쓰는 것을 의미합니다.충돌을 방지하려면 Multi-Account를 사용할 때
rewriteToLocalEnvFileFalse로 설정해야합니다.
봇 닉네임
botnickname <==> botdisplayname
- a2 <==> 클로드-인스턴트
- A2_2 <==> Claude+
- 비버 <==> gpt-4
- capybara <==> 세이지
- Nutria <==> 잠자리
- Chinchilla <==> chatgpt
- Hutia <==> Neevaai
- 자신의 봇
/**
* send message to bot
* @param text user input
* @param botNickName bot nick name, like capybara(Sage) / a2(Claude-instant) / a2_2(Claude+) etc.
* @param withChatBreak Add a chat break or not. (Empty context)
* @param callback When ws on message, will invoke this callback function.
*/
await client . sendMessage ( text , botNickName , withChatBreak , ( result : string ) => { console . log ( ` ${ result } ` ) } )텍스트 : 문자열
BotnickName : 문자열
Withchatbreak : 부울
콜백 : (결과 : 문자열) => void
경고 : 1 분 이내에 너무 많은 요청으로 인해 (무료) 계정이 차단됩니다 !!!!!
1 분 안에 약 20 개의 메시지를 보냈는데 이제 차단되었습니다. 오류 메시지로 로그인이 실패했습니다.
Something went wrong. Please wait a moment and try again.그러니 당신이하고있는 일을 알고 있는지 확인하십시오 ~
const res = await client . addChatBreak ( botNickName ) ; const res = await client . deleteMessage ( messageIds ) ; const res = await client . purgeAllMessage ( ) ;모든 봇 메시지 삭제, poe.com> 설정> 모든 메시지 삭제
const history = await client . getHistory ( botNickName , count ) ; const history = await client . getBotByNickName ( botNickName , retryCount , retryIntervalMs ) ; const history = await client . getNextData ( ) ;
poe-formkey/buildId/latest messages(예 : 최신 5 개의 메시지)와startCursor(STARTCURSOR를 사용하여 기록 메시지를 가져 오기) /availableBots/x-forwarded-for/ ......
await client . updateAllBotInfo ( )이 기능은 Poe-Formkey, BuildId, 최신 메시지, STARTCURSOR 및 모든 봇 정보를 가져옵니다 (ChatId / id,이 두 매개 변수는 사용됩니다).
이 함수는
poe-formkey/cookie/buildId/${botDisplayName}_chatId와${botDisplayName}_idto .env 파일을 설정합니다 (이 매개 변수는 쿠키와 동일하며 매번 요청할 필요가 없습니다).다음에 MSG를 봇에 보낼 때 봇 정보를 다시 가져올 필요가 없습니다. 클라이언트는 local .env 파일에서
buildId와 같은 필요한 매개 변수를 얻게됩니다.
예 - SendMessage.ts
예 - SendMessage.ts
예 - 프록시
예 - history.ts
예 - FetchAllNeedEdInfo.ts
MIT