The modern messaging tools that chatbots run on offer much more ways to interact compared to what previous incarnations of chatbots had, such as those used on IRC or AIM. Much advise on building chatbots that’s out there quietly assumes that all chatbots are just text-in-text-out, which doesn’t match with the platforms they are on.…
A Messenger Adventure chatbot
For quite a while now I’ve had the idea to create a chatbot that works like one of those old-style text adventures like Zork. Recently I bumped into a free course on beginning a Facebook chatbot, and decided to really give it a go. The end result is A Messenger Adventure.
Welcome to Adventure, a game of danger, and low cunning. No Messenger should be without one!
The game now is really quite small and you should be able to finish it in ten minutes or so. You can click any of the quick replies (which also serve as a legend of possible room actions) or type out the command. I don’t do any fancy synonym matching or command interpretation yet, so if you typo you’re out of luck (but you can try again).
Whilst you can’t yet be really eaten by a Grue, I did sneak in at least one easter egg.
I wrote the bot using FacebookMessengerBot.js, a lovely ES7 library with most of the stuff I need and I decided to write A Messenger Adventure with it. The api is not entire complete, and some of the code doesn’t handle too well, but I might contribute some fixes in the future.
On top of this library, I wrote a system that can handle rooms, actions and states, the three of which allow you to do some rudimentary text adventure style puzzles. I based most of my scenario on Zork.py and added some classic Zork elements.
For the logo, I really wanted to have a combination of the Zork logo style, and old-school pixel art. With the help of this page on Pixel Art Rocks and Stones I created the above logo. Not great, but not too shabby for a first try either. And plenty recognizable.
The A Messenger Adventure scenario is pretty small, but with my rooms-system I can easily expand it, or create an entirely new story. If there’s interest, I might release the rooms-system library so let me know if you’d like to create your own messenger text adventure!
For now, feel free to checkout the bot!
After you have made your awesome new Messenger bot, it’s time to demo it. If you made a bot for a professional client you don’t really want to give a demo with the always-present Messenger sidebar with your other personal chats visible for everyone. Facebook Messenger always has a sidebar with all your recent chats, including…
Many of the “smart” chatbots with Natural Language Processing and Artificial Intelligence still have a hard time keeping a conversation going. They keep forgetting whatever it was you were talking about even if you can see it plainly in the message right above! …