INNER CODE UNIT · TypeScript
start
open-wa/wa-automate-nodejs · demo/index.ts:67
async function start(client: Client) {
app.use(client.middleware(true));
app.listen(PORT, function () {
console.log(`\n• Listening on port ${PORT}!`);
});
globalClient=client;
console.log('starting');
const me = await client.getMe();
console.log("start -> me", me);
// const chats = await client.getAllChatsWithMessages(false);
// console.log("TCL: start -> chats", chats)
// console.log("TCL: getAllChatsWithMessages ->", chats.length, chats[0]);
// console.log("TCL: start ->chats", chats[0].msgs);
// const newMessages = await client.getAllUnreadMessages();
// console.log("TCL: start -> newMessages", newMessages)