QuoraのPOE用のリバースエンジニアリングNode.jsクライアント。
サポート:必要な情報を取得し、.envファイルに書き込みます|別のボットにメッセージを送信します|プロキシをセットアップ|メッセージをクリア/削除/パージ|履歴メッセージを取得|ボット情報を取得|次のデータを取得します
私はまだこれに取り組んでいるので、安定していないかもしれません。問題が発生した場合は、問題を作成してください。
npm install poe-node-api要件:
- ノード> = 18
- .ENV:
poe-formkey/cookie/buildId/ botidのような必要なパラメーションを保存するには.....
poe.comからCookieを入手:F12/検査、アプリケーション> Cookies> https://poe.com> PB
プロジェクトルートパスに.envファイルを作成し、.envファイルにCookieを追加します
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」ファイルでそれらを上書きすることを意味します。紛争を防ぐために、マルチアカウントを使用する場合は、
rewriteToLocalEnvFilefalseに設定する必要があります
ボットニックネーム
botnickname <==> botdisplayname
- a2 <==> claude-instant
- A2_2 <==> Claude+
- ビーバー<==> gpt-4
- カピバラ<==>セージ
- Nutria <==> Dragonfly
- 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:boolean
コールバック:(結果:文字列)=> 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 /buildId/latest messages(最新5メッセージなど)を取得し、startCursor(StartCursorを使用して履歴メッセージを取得する) /availableBots/x-forwarded-for/ ......
await client . updateAllBotInfo ( )この関数は、Poe-Formkey、BuildID、最新メッセージ、StartCursor、およびすべてのボット情報を取得します(ChatID / ID、この2つのパラメーションが使用されます)。
この関数は、
poe-formkey/cookie/buildId/${botDisplayName}_chatIdおよび${botDisplayName}_idto .envファイルを設定します(これらのパラメーターはCookieと同じであり、毎回要求する必要はありません)。次回、任意のボットにMSGを送信すると、ボット情報を再度取得する必要がなくなります。クライアントは、ローカル.ENVファイルから
buildIdなどの必要なパラメージを取得します。
例-sendmessage.ts
例-sendmessage.ts
例-Proxy.ts
例-History.ts
例-fetchallneededinfo.ts
mit