intergram
                                
                                 intergram copied to clipboard
                                
                                    intergram copied to clipboard
                            
                            
                            
                        Architectural observations and thoughts
First of all, great repo 👌 thanks for sharing it, @idoco 👍
There are the following general difficulties at the Telegram site which I don't know how to workaround and which prevent wider adoption on my opinion:
- 
Given there are less operators than visitors, handling of the incoming messages with the "REPLY" command is inconvenient, non-intuitive and easy to disregard, but the price for that is high (broken conversations). 
- 
An operator cannot be always online, and even if he or she receives the message, there's no guarantee of respond. That's OK, but handling that is non-trivial. E.g. Telegram provides "last seen" or "online" statuses, but the bots unfortunately cannot access them. Eventually the visitor has to wait, and everyone hates that. 
Please, share your thoughts.
Hi @blokhin, great points, thanks for your feedback.
Many of the trade-offs in Intergram, revolve around the desire to keep the bot server completely stateless. This concept makes it possible for it to support an extremely large amount of visitors from many different websites very efficiently.
Directing all the visitors' messages to one Telegram chat is done to avoid storing state on the server. This way the only thing the server needs to know to route an incoming message is the chat ID which is stored in the web-client configuration. I agree the this creates an unpleasant user experience for the admins when there is more than one visitor at the same time (Which don't happen very often to me), and open to hearing of any way I can improve this.
A simple way to improve the problem of admin availability hours is to add an option to configure the chat availability in the chat configuration json. We just need to define the right format and add an optional "away message" that will be displayed outside the availability hours.
Let me know what you think.
Exactly, you said that:
to support an extremely large amount of visitors
and
an unpleasant user experience for the admins when there is more than one visitor at the same time
Paying respect for stateless, let's admit although that this is the question of trust to Telegram. They might decide one day to kick out the certain bots from their platform and wipe their logs, just because... And that happened already many times during Russian VK period. OTOH it's easy to add a storage layer.
The admin availability hours is something, I agree, but still the problem remains. Given an admin's device receives a message in time but the person is unable to answer immediately, what should we do? Note this is a crucial business-logic question, since failing to answer it we miss the leads.
Sorry for this flow of criticism. I actually like your idea a lot and try to discover and debate its pitfalls.
@blokhin To solve the problem of the "unattendance" (when the operator is unable to answer immediately), I find it really straightforward if you simply adjust the message of autoNoResponse to mention the working hours and the alternatives of communication available for the visitor.
About the problem of having multiple operators, I believe most of such cases are well established companies, and as such they should find a better solution (payed solutions, clearly). This is a free solution, and I believe it works perfectly for freelancers and small companies with 1 operator (who need to save all that money).