Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat adapter for Microsoft Teams #1194

Open
vanstee opened this issue Nov 30, 2016 · 0 comments
Open

Chat adapter for Microsoft Teams #1194

vanstee opened this issue Nov 30, 2016 · 0 comments

Comments

@vanstee
Copy link
Member

vanstee commented Nov 30, 2016

We've had a few users mention they were interested in using Cog with Microsoft Teams. To do so we'd have to write another chat adapter, just like we have for Slack and Hipchat. This includes raw communication with their API, but also a template processor, for converting greenbar directives into a format supported by Slack.

So we can better gauge interest, 👍 this issue if you would use this adapter.

Implementation notes

Cog adapters are written in Elixir and are compiled along with the rest of Cog. However, they have been properly isolated from the rest of the codebase, so writing a new adapter is fairly straightforward. You'll need to implement both a chat provider and a template processor.

Chat provider

Chat providers implement callbacks defined in lib/cog/chat/provider.ex; things like looking up a user or a room and sending messages. Take a look at the Slack provider as an example: /lib/cog/chat/slack/provider.ex. I haven't seen an Elixir library for talking to the Microsoft Teams API yet, so you may need to implement your own similar to the slack lib we use.

Template processor

Cog uses greenbar templates to provide a unified templating language for all chat providers regardless of what formats they expect your messages to be in (for instance Slack accepts Markdown, while Hipchat accepts HTML). To correctly render templates into a format Microsoft Teams understands you'll have to implement a template processor, which will convert maps like %{"name" => "bold", "text" => text} to a string of Markdown like "*#{text}*". Because Microsoft Teams supports markdown messages, you should be able to reuse most of the Slack template processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants