Extending @CocktailsBot with interactive commands

Twitter bot that posts cocktails every hour

Pulling, formatting and publishing a cocktail recipe every few hours is fine, but somewhat limited. It serves well enough as a source of inspiration when you have no idea what to make, but what if you need the recipe of a particular cocktail at a particular moment? Or even better, what if you’re craving a cocktail based on that one ingredient you have at home?

With the excuse of @CocktailsBot surpassing 300 followers and 1000 tweets, I decided to extend its functionality by adding a couple of interactive commands:

  • Make me something with <ingredient>.
  • Make me a <cocktail>.

The goal of this is enabling users to actively affect the bot’s behavior, and turn it into a dual-channel mean of communication instead of a mere emitter. With these new features, every time a Twitter user mentions @CocktailsBot with one of these two patterns, the bot will parse and interpret the query, try to satisfy it, and answer accordingly.

After all, if drinking is a social activity, my bot should also be able to socialize 🙂

Continue reading “Extending @CocktailsBot with interactive commands”