Un cliente de nodo de ingeniería inversa para el POE de Quora.
Soporte: Obtenga información necesaria y escriba en el archivo .env | Enviar mensajes a diferentes bot | Configurar proxies | Clear/Eliminar/Purge Mensajes | Obtener mensajes de historia | Obtener información de bot | Obtenga los siguientes datos
Todavía estoy trabajando en esto, por lo que podría no ser estable. Si tiene algún problema, cree un problema.
npm install poe-node-apirequisito:
- nodo> = 18
- .env: para almacenar los parámetros necesarios como
poe-formkey/cookie/buildId/ botid .....
Obtenga Cookie de Poe.com: F12/Inspect, Application> Cookies> https://poe.com> PB
Crear archivo .env en la ruta de la raíz de su proyecto y agregar cookie al archivo .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).Cómo crear un cliente:
import { PoeClient } from "poe-node-api" ;
const client = new PoeClient ( { logLevel : 'debug' } ) ;Cómo Init Client
await client . init ( )buildId / poe-formkey y los sobrescribirá en el archivo local'env '.Para evitar conflictos, cuando se usa una cuenta múltiple, debe establecer
rewriteToLocalEnvFileen falso
Apodos de bot
botnickname <==> botdisplayname
- A2 <==> Claude-Instant
- A2_2 <==> Claude+
- Beaver <==> GPT-4
- Capybara <==> Sage
- Nutria <==> Dragonfly
- chinchilla <==> chatgpt
- Hutia <==> Neevaai
- Tu propio bot
/**
* 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 } ` ) } )Texto: cadena
botnickname: cadena
WithChatbreak: booleano
devolución de llamada: (resultado: string) => void
ADVERTENCIA : ¡Demasiadas solicitudes en un minuto darán como resultado que la cuenta (gratuita) esté bloqueada!
Había enviado unos 20 mensajes en un minuto, y ahora está bloqueado. Iniciar sesión falló con el mensaje de error:
Something went wrong. Please wait a moment and try again.Así que asegúrate de saber lo que estás haciendo ~
const res = await client . addChatBreak ( botNickName ) ; const res = await client . deleteMessage ( messageIds ) ; const res = await client . purgeAllMessage ( ) ;Eliminar todos los mensajes BOT, es igual a hacer clic en Poe.com> Configuración> Eliminar todos los mensajes
const history = await client . getHistory ( botNickName , count ) ; const history = await client . getBotByNickName ( botNickName , retryCount , retryIntervalMs ) ; const history = await client . getNextData ( ) ;Puede obtener
latest messagespoe-formkey/buildId/ Últimosx-forwarded-forcomo los últimos 5 mensajes) ystartCursor(use StartCursor para obtener mensajes de Historia) /availableBots
await client . updateAllBotInfo ( )Esta función obtendrá Poe-Formkey, BuildId, los últimos mensajes, StartCursor y toda la información de bots (chatid / id, se utilizarán estos dos parámetros).
Esta función establecerá
poe-formkey/cookie/buildId/${botDisplayName}_chatIdy${botDisplayName}_ida .env archivo (estos parámetros son los mismos que las cookies y no necesitan ser solicitadas cada vez).La próxima vez que envíe un mensaje a cualquier bot, no necesitará obtener información de BOT nuevamente, el cliente obtendrá parámetros necesarios como
buildIddesde el archivo .env local.
Ejemplo - sendMessage.ts
Ejemplo - sendMessage.ts
Ejemplo - Proxy.ts
Ejemplo - History.ts
Ejemplo - fetchallneededinfo.ts
MIT