From 89c2d62ff5d4420cee69a95189b165223693ef18 Mon Sep 17 00:00:00 2001 From: danielcardeenas Date: Mon, 10 Jun 2019 09:41:52 -0500 Subject: [PATCH] Update readme --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b3daef59..56370c75 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # 🤖 sulla + Javascript whatsapp framework (web whatsapp driver) ## Instalation @@ -6,19 +7,21 @@ Javascript whatsapp framework (web whatsapp driver) ```bash > npm i sulla ``` + ## Usage ```javascript -import { init } from 'sulla'; +import { create } from 'sulla'; -init().then(client => start(client)); +create().then(client => start(client)); function start(client) { - client.onMessage().subscribe(message => { - if (message.body === 'Hi') { - client.sendText(message.from, '👋 Hello from sulla!'); - } + create().then(client => { + client.onMessage(message => { + if (message.body === 'Hi') { + client.sendText(message.from, '👋 Hello from sulla!'); + } + }); }); } - ```