mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Port poe messaging to JS
This commit is contained in:
21
poe-test.js
Normal file
21
poe-test.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const poe = require('./poe');
|
||||
|
||||
async function test() {
|
||||
const client = new poe.Client();
|
||||
await client.init('pb-cookie');
|
||||
|
||||
const bots = client.get_bot_names();
|
||||
console.log(bots);
|
||||
|
||||
await client.purge_conversation('a2', -1);
|
||||
|
||||
let reply;
|
||||
for await (const mes of client.send_message('a2', 'Hello')) {
|
||||
reply = mes.text;
|
||||
}
|
||||
|
||||
console.log(reply);
|
||||
client.disconnect_ws();
|
||||
}
|
||||
|
||||
test();
|
Reference in New Issue
Block a user