Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture help #371

Open
alangarbo opened this issue Jun 2, 2020 · 2 comments
Open

Architecture help #371

alangarbo opened this issue Jun 2, 2020 · 2 comments

Comments

@alangarbo
Copy link

I have an architectural question about how to use this library on a system that I am developing.
The solution has to be permanently waiting for new messages and do something. With the following code I can start the service and wait for messages:

const sulla = require('sulla');
sulla.create().then((client) => start(client));
function start(client) {
client.onMessage((message) => {
if (message.body === 'Hi') {
client.sendText(message.from, '👋 Hello from sulla!');
}
});
}

My question is how can I listen to new messages and also be able to send messages to a contact or a new number. I dont want to to replay a incomming message, I need the application send one ( send a notification for some events to the customers). I know how is the code to send text and multimedia messages
My question is how to put all together, the architecture of the solution.

I can do a script that checks for new messages in a database or a queque and send it using sulla, but there is already another process that is waiting for new messages.

I think in use Express to get a endpoint where the app can use as an API to send mensage , but I dont know how to do the startup the sulla client once to be use for every request and also to the same client lisening for new message.

Can someone help me?
Thanks

@joedutra
Copy link

joedutra commented Jun 6, 2020

the repository is deprecated use

Install
npm i @s2click/venom
https://github.com/s2click/venom

@vasani-arpit
Copy link

@alangarbo So, every time a new message comes from any one you want to send a completely unrelated message to completely unrelated person which is in your contact. Is it something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants