You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
@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?
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
The text was updated successfully, but these errors were encountered: