cog
cog copied to clipboard
Develop Adapter for Rocket.Chat
Hey guys, I want to integrate COGs to Rocket.Chat platform, Was wondering if we could speed up its development.
Cog requires two general categories of functionality in order to integrate with any chat system:
- Chat System API - Cog uses the API to lookup rooms and users and join/leave rooms. If the chat system's message stream interface is read-only then Cog will also use the API to send messages.
- Message Stream Interface - Cog assumes access to a soft real-time message stream containing all messages sent in rooms Cog has joined as well as all private messages sent to Cog.
Using Rocket.Chat's API looks straightforward based on the API docs I read. Getting access to the real-time message stream is less clear to me as Rocket.Chat streams messages using Meteor's DDP.
Since Cog is written in Elixir we'd need a DDP client lib to access the stream -- unless Rocket.Chat exposes the stream another way, of course. The only DDP client lib for Elixir I could find is Philae which hasn't had a commit in almost 2 years. If Philae worked well enough, or could be made to work well enough, then writing a Rocket.Chat provider should be possible.
tl;dr There's a few questions needing answers before anyone should attempt building a Rocket.Chat provider:
- Does Rocket.Chat's API provide all the required functionality? The callback functions listed here are a good place to start.
- Which interface do Rocket.Chat clients use to send messages? The REST API or message stream?
- Does Rocket.Chat expose a non-DDP version of the real-time message stream?
- If not, does the Philae DDP client work well enough? If not, how hard would it be to bring it up to date?
I'd suggest having a look at the API again for Rocket.Chat - It's come miles since December last year.
I'm not sure how your integration with slack works, but the API should be identical to slack as everything been designed to be 'slack compatible' (Although maybe the older-one - I have no idea how slack does its newer integration with just the token being specified.)
Does this help at all?? https://github.com/RocketChat/Rocket.Chat/issues/4287