You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: