Do you own Programming the Microsoft Bot Framework, by Joe Mayo? If so, you’ll want to read this—we have an important update regarding the code in the book. Here is an explanation from Joe regarding this issue.
My latest book, Programming the Microsoft Bot Framework, published recently. It was a joy to write and I hoped it would be error free. However, the reality is that books are rarely perfect and we need to publish their errata.
The focus of this post is to highlight a problem that people will encounter when running sample code. There are three primary applications that the book uses to illustrate Bot Framework features: Rock-Paper-Scissors Chatbot, Wine Chatbot, and Music Chatbot. Rock-Paper-Scissors stands alone as a game someone could play. However, both Wine Chatbot and Music Chatbot use 3rd-party APIs. Wine Chatbot was built with the Wine.com API and Music Chatbot was built with the Groove API. Unfortunately, both the Wine.com and Groove APIs have shut down. This means that the code for the demos, as described in the book, won’t run.
Therefore, instead of relying on those APIs, I refactored and updated the code on my MS Bot Framework Book GitHub site. Here are the changes:
- Wine Chatbot: No longer uses a 3rd-party API. It consumes sample dummy data and runs fine.
- Music Chatbot: Microsoft partnered with Spotify for handling Groove customers. Therefore, I refactored the code to use the Spotify API. There are minor changes, but the code runs the same as the original, except the data source is different.
In the book, I explain how the back-end code communicates with each API. However, the code has a separate data layer, abstracting most of the details of the data from the rest of the code. This also means that the Bot Framework and associated features don’t change. The only change is how the data is consumed, which doesn’t affect the material on how the Bot Framework works. This is similar to how we build systems in real life – we use separation of concerns and build abstractions that minimize the impact of inevitable changes.
Please download the code (https://github.com/JoeMayo/MSBotFrameworkBook), inspect the changes, and you’ll see what I mean.