I Made a Skype Bot – His Name is Zoltar

newSkypeBot

Note: This version of Zoltar is outdated. Please see Zoltar V2 if you want to add him as a Skype contact!

Over the weekend, I got the chance to hash out a new bot idea. It’s a little silly, which you’ve probably guessed since I named the thing Zoltar.

Right now my bot is unpublished. So if you search for it, you won’t be able to find it. Work is still ongoing, but you can add my Zoltar Skype bot as a contact using this link.

He works fine in a one-to-one conversation, but he works better in a group. Here’s a quick list of what he can currently do:

———
Ask Zoltar to display a GIF (via Giphy)
z gif celebration
z gif bob’s burgers louise

Ask Zoltar for a video (via YouTube)
z vid bass kate davis

Ask Zoltar for a fortune (via Twitter)
z fortune

Help
z help
———

As you can see, most of the interactions begin with you invoking Zoltar by typing in the letter “z,” followed by some command. He’s good at retrieving stuff for you (animated GIFs, videos, and predictions)… but right now he’s a little on the quiet side.

That is to say – if you try to talk to him directly, or ask him some questions directly… he likely won’t have a response. I don’t have him set up as a conversational bot. Right now, he’s more of a helper.

To me, some of this basic functionality is what I liked about Skype – the ability to easily pull in media from outside the conversation, and bring it within.

The bot as a standalone entity isn’t what I’m necessarily after. It would be interesting to try to simulate some kind of artificial intelligence. But right now I want the Zoltar bot to make the group chat more fun, more interesting. Instead of being the oddball friend that everyone at the party wants to talk to… I’d rather he be the guy at the party that cracks a great joke at the perfect time.

While most of the tech folks I know tend to favor Slack (RIP Glitch), we use Skype at work. It’s a fine (read: free) means of communication, but I like how scriptable Slack is, how much you can customize it. This bot is me trying to get a little of that action in Skype.

I’ve been needing a project, and this one seems to have stepped up and grabbed my attention. Once again, I seem to have found an interest in something that really has no means of bringing in any kind of income whatsoever. Seems to be a trend.

Curious to try coding a Skype bot of your own? I started off using an Echo Bot tutorial, and went from there.

Getting the basics up and running isn’t too bad, though I did run into some bumps in the road getting my bot to respond. If you do give this tutorial a whirl, I will mention this one thing:

During the setup process, when I was using the Application Registration Portal, I selected the wrong string as my Application Secret.

Originally, I clicked on Generate New Key Pair, which resulted in a new entry appearing in the admin labeled Private Key. I used this string as my App Secret.

However, it appears that what I should have done was click on Generate New Password and used that string instead.

I made a post to the developer forum about this, so maybe they’ll update the tutorial to make things clearer. Cost me a decent chunk of time, and once I got the right string in place – things worked fine.

Initially tried deploying to Heroku, but got some weird results. I could see data going back and forth, but nothing ever returned to my Skype app. Even weirder – 19/20 messages would result in no content being returned, but 1/20 would actually work. It was bizarre.

I tried a lot of fixes to no avail. Worked fine for me locally, but just not fine when I deployed to Heroku. My fix, while a clunky one, was to deploy to Azure instead.

Bonus: I got to learn about ngrok, and used that as part of my local testing. Neat.

For now, I’ll likely keep adding features to Zoltar as I can. It’s fun slowly shaping this thing up from scratch. It’s a pleasure to watch him in action at work – the randomness of the GIF choices and fortunes is exactly what I was after. And it’s doubly fun for me, as I get to watch my coworkers interact with this thing that I made.

Oh – and a note on the “fortune” command: I revisited the code I used on a lot of my Twitter bots, and incorporated it into Zoltar. When you prompt him for a fortune, he searches Twitter for posts that contain one of the following: “you will get, you will find, someday you will, etc.”

It then chops off anything before this, and spits out the rest. Any posts with @replies or #hashtags or URLs are discarded. So far it’s worked pretty well, though I definitely want to go back in and tinker with that some more.

I’m fairly certain I’ll not be able to call him Zoltar, once he goes live. But it’ll still be something with a “Z” in the name, as I’ve grown fond of that particular keystroke initialization.

If you’re on Skype, I invite you to add Zoltar as a contact, and give him a whirl. Would love to know what you think.

And if you’re a dev messing around with things, feel free to ping me with any questions about my setup (my Skype handle is avoisionFJ). I’ll post my code up on GitHub eventually, but still doing a lot of messing around for now.

Related:
Desire Bot: A Twitter Bot That Re-Posts What the World Wants
Villanelle Bot: Poems in the Villanelle Form, Created Using Random Posts from Twitter

This Post Has 0 Comments

Leave A Reply