Zoltar the Conversationalist
Earlier this week, I added in some more functionality to my Skype bot, Zoltar. Previously, it would only respond when a user requested a fortune (a search on Twitter for a prediction).
I adjusted things so that when he is invoked (when someone begins a sentence with ‘z’ and a space), he will try to respond by pulling in a comment from Twitter.
There’s a lot of fun stuff at work, under the hood. I’m using RiTa.js to determine which words a user types are nouns and verbs. I then have a sprinkling of logic that checks for specific keywords (if you use ‘why’ in your message, I will add the word ‘because’ to Zoltar’s search).
For previous bots, I used to search for complete tweets, and use them 100% start to finish. For this approach, I decided to look for the occurrence of a phrase – and just grabbed the text that began with that, until the end.
This opens up a lot more possible responses. Granted, some of them don’t quite make sense, but they seem to hit more often than they miss. It’s a pattern I may end up tinkering with more, in the near future.
For now, I think I’ve hit my limit for what I want to do with Zoltar. Functionally, he mirrors some basic Slack actions I wanted to have in Skype. And beyond the fortune and responses, there’s not a lot more I could see him doing.
I still have a few Easter Eggs hidden in the code, and I’m waiting for them to get triggered. I have to say – even after a week or so of having this bot be part of my work chat room, I’m not tired of him. I still get delighted watching my coworkers interact wtih him, asking for GIFs and fortunes. It’s really fun.
If you want to try things out, you can add Zoltar as a contact in Skype.