PawanOsman / GoogleBard

GoogleBard - A reverse engineered API for Google Bard chatbot for NodeJS
https://bard.google.com
MIT License
415 stars 57 forks source link

ERR_REQUIRE_ESM #39

Open chinazhaoht opened 1 year ago

chinazhaoht commented 1 year ago

project/node_modules/ts-node/dist/index.js:851 return old(m, filename); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module

yeasin6152 commented 9 months ago

const bardModule = await import('googlebard'); const Bard = bardModule.Bard;

let cookies = __Secure-1PSID=<YOUR_COOKIE>; let bot = new Bard(cookies, { inMemory: false, savePath: "./conversations.json", // this is being done to save crucial information about the conversation so the bot remembers it });

let conversationId = "test_id";

let response = await bot.ask("My name is Mehul", conversationId); console.log(response);

(Flow the step)