Looking at the examples the only way I can see to access the new messages is through a call to :
$messages = $bot->getMessages();
I don't get how I'm supposed to answer the new messages sent by users? The only possible solution is through a repeated call (every 10 seconds at least) to the API and calling the $bot->getMessages(); over and over again?
That's going to waste a lot of resources both on bot's server and the API.
What is the recommendation here?
In the current architecture of Soroush bots, the SSE protocol is used to receive messages in hopes of providing WebHook capabilities in the near future.
Use the methods provided to send messages to users for examples of which you can visit this page.
Looking at the examples the only way I can see to access the new messages is through a call to :
$messages = $bot->getMessages();
I don't get how I'm supposed to answer the new messages sent by users? The only possible solution is through a repeated call (every 10 seconds at least) to the API and calling the$bot->getMessages();
over and over again? That's going to waste a lot of resources both on bot's server and the API. What is the recommendation here?