40+ chatbot boilerplates (for Slack, Intercom, Telegram, Discord, Messenger and more) that you can use to quickly build your own custom bot
Last November, we launched Hasura Hub — a centralised repository where developers can contribute stack or app boilerplates that other developers can clone, modify and deploy to get a headstart on their own projects. As of now, it’s a 120 strong collection of stack and application starter kits.
Alongside, we also launched #Pub2Hub challenges — a series of themed contests for community contributions to Hub. The theme for the first challenge was Chatbots, with the best projects receiving Hasura swag boxes and 3 months of Hasura credits.
This blog post showcases five of the best contributions. Each of these boilerplates come with the API integrations and all the setup done for you out of the box that you can just `git push` to deploy. All of them will serve as excellent starting points for your own custom bots.
Outside of Twitter, Facebook Messenger is the most popular bot platform, and with over 1.2 billion active users, why wouldn’t it be? As one of the world’s largest social networks, businesses can exploit Messenger’s ubiquity with bots that provide customer support and customer engagement.
About the project: This bot features currency conversion (including for cryptocurrency) as a sample use-case and is written using Node.js. It showcases integrations with the basic Messenger bot webhooks, and with a few external APIs (one for fetching information about a country, one for exchange rates for traditional currencies, and one for crypyocurrency rates). The documentation also serves as a tutorial for building, deploying and publishing a Facebook bot.
Slack is now one of the most popular workplace communication tools, if not the most popular. One of its best features is the ability to write (and quickly add to your workspace) bots that automate common and repetitive tasks, like turning on your Particle Photon enabled coffee machine 😶.
About the project: This bot, featuring horoscopes as a use-case, was written using Node.js Express. It integrates with the Slack Outgoing Webhook and the Slack Post Message API (the two basic Slack Bot APIs) and one external API (Tapasweni Pathak’s horoscope API). The documentation also tells you how you can add a Slack Bot to your workspace.
Discord is a Slack/Skype alternative, used primarily by gamers. Like Slack, Discord allows you to add bots to your server. (Unlike Slack, Discord does not have limits on searchable messages, which is why we recently decided to move to Discord for the Hasura community).
About the project: This project contains: 1) a custom REST API written in Python Flask and hosted over an Nginx server through Gunicorn. This API fetches movie and theatre times for a city using an API for BookMyShow. 2) a Discord Bot that interacts with the showtimes REST API and with the relevant Discord webhooks. This can be integrated with your Discord server in five minutes. You can modify either 1 or 2 (or both) to build your own Discord bots.
This one holds a special place in our hearts. Git is the dominant collaboration method for most software projects, and Github is its most popular implementation. Hasura uses git extensively — in fact, everything in Hasura is declarative and powered off of a git repo. This is what gives git push hasura master such power.
About the project: Github bots respond and take some action based on changes in a Git repo (commits, issues, etc). This particular bot uses Node.js Express and a GitHub API by written by Philip Schatz to post messages when an issue is opened or closed. To add the bot to a Git repo, follow the instructions in the Readme. To modify the bot, simply head to the microservices/bot/src/ directory and start editing server.js.
Telegram is an alternative to Whatsapp, that became popular originally because of its claims around security. It has since evolved to add more features and was one of the first chat platforms to support bots, way back in 2015.
About the project: Keeping up with the times (and because its volatility makes this necessary), this bot features bitcoin rate tracking as a use-case. The bot uses the telebot package (for getting messages from/posting to Telegram) with a Node.js server. The server integrates with the Coindesk API for fetching Bitcoin rates.