Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.64 KB

README.md

File metadata and controls

39 lines (24 loc) · 1.64 KB

UPDATE

Change your webhooks from https://tfsbot.io to https://tfsbot.com!!!

TFS Skype Bot

This is a simple TFS bot based on Microsoft Bot Framework.

It uses TFS webhooks to send messages to your team chats about pull requests and builds.

We use it with Skype only. It was not tested with any other channel.

How to use it

You can either use hosted version at https://tfsbot.com or host it yourself. After adding the bot to the check it will print you the links you need to use in TFS webhooks.

In TFS settings setup webhooks for repositories/types you want to be notified about. Use the following urls:

  • for pull requests: {bot_url}/api/webhooks/pullrequest/{your_secret}
  • for builds: {bot_url}/api/webhooks/build/{your_secret}

How does it work

After you send setserver message to the bot. The secret (ServerId) is saved to Azure Table Storage in two forms: Client

  • Partition Key first character from UserId
  • Row Key UserId + UserName
  • ServerId

ServerClient

  • Partition Key ServerId
  • Row Key UserId
  • BotInformation

In this way the bot can get back info about current server for the user (you can get it by sending a message @{bot_name} getserver) and also get all registered clients for the given server id (secret), that's needed once webhooks are called and messages needed to be sent to all registered clients (group chats).

Lesson learned

  • don't write stupid messages in activity.CreateReply(message) if the message contains markup (>tag&lt); out of the whitelist the message will not be delivered at all regardless of the success response.