operable / cog

Bringing the power of the command line to chat
https://book.cog.bot/
Other
917 stars 73 forks source link

Develop Adapter for Rocket.Chat #1059

Open diegodorgam opened 7 years ago

diegodorgam commented 7 years ago

Hey guys, I want to integrate COGs to Rocket.Chat platform, Was wondering if we could speed up its development.

kevsmith commented 7 years ago

Cog requires two general categories of functionality in order to integrate with any chat system:

  1. 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.
  2. 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:

JSzaszvari commented 7 years ago

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