RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.24k stars 10.43k forks source link

Broadcast message support from bots #10667

Open bizzbyster opened 6 years ago

bizzbyster commented 6 years ago

https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages

The idea is bots need to send broadcast messages in batches in order to avoid scale limitations.

TwizzyDizzy commented 6 years ago

A little more detail would be forthcoming, otherwise I'd just ask: why?

Cheers Thomas

bizzbyster commented 6 years ago

Sorry about that...

So typically DM bots do not introduce any sort of scaling problem. They are essentially like extremely active users with lots of DMs going. But, since the bots activity is triggered by a human user sending a message, the bots work is spread out in time so scale is not typically a problem.

On the other hand, if a bot needs to send a notification or a message to all of the users who have subscribed to it, then it needs to simultaneously send a message to thousands or even millions of users. This can be done on the bot side but then that means that not only does rocket.chat server need to handles a huge number of outgoing messages to connected users but also it will need to process a huge number of incoming messages from the bot.

Better would be for rocket.chat server to explicitly support a "broadcast" or "multicast" message received from a bot that can be sent to all or a subset of the users who have subscribed to a bot. I put broadcast/multicast in quotes b/c there is not technically a broadcast/multicast channel between Rocket.chat server and its clients.

Hope that helps.

@timkinnane anything to add?

timkinnane commented 6 years ago

Just to second that this is a real requirement I've come up against in a commercial role. Bots were making announcements to all users, but needed to go as DM because it was the entry point to a one-to-one scripted interaction, so just posting in channels wasn't enough. We had worked it out to just stay under the rate limit, but it could get slow for large user bases. I think the utility of a broadcast DM is good. I can see it being extra useful for any instance with custom user fields to query for sub-collections that might need targeted communication for whatever reason.