Lately I have been working on a project using the git distributed version control system and Atlassian’s code hosting service, BitBucket.
The project, known as ‘GC Skype Bot’, whilst still very rough around the edges, is now a public repository so that you can take a peek, here’s a link: https://bitbucket.org/grub/gc-skype-bot. Fellow developer ‘MushyBean‘ has also committed some changes in this repository.
As the name may suggest, it is a chat bot for the popular instant messenger Skype, although not a pesky or illegal one – just one that aims to bring extra functionality and entertainment to a specified Skype group chat specifically. Currently it lacks a great deal of features, and the available commands are scarce due to the development of the back-end being more important. There are however already some available commands (known as ‘units’), these are currently:
- Roll the Dice – rolls a virtual six-sided die.
- Help – provides help text (such as syntax help) for a specified command.
- Command List – lists all of the available commands.
- Quit – exits the bot ‘elegantly’ via a command.
These commands can be triggered using the trigger prefix ! and the trigger, which for these units is, respectively: !rtd, !help <command>, !commands, !quit.
Of course, not all users should be allowed to run all commands such as !quit, that would not be fun, so I have implemented a user flags system, which essentially allows an administrator to flag/tag/denote some permissions (or the opposite) to certain users through a simple and structured XML file. For example, the !quit command will not execute unless it was sent by a user with the ‘master’ flag. There are also some other preventative measures that have been implemented, such as a timeout if the user is trying to execute a command too quickly.
If you’re interested, the source code is available here, it’s written in C# with Visual Studio Express 2013, requires .NET Framework 4.5, and needs the Skype4COM library as a reference (usually found in C:\Program Files (x86)\Common Files\Skype). Please keep in mind this is a very early and experimental project created by amateur programmers with little experience, so compile and use at your own risk!
It is a console application, so to launch it currently you must specify a couple of parameters:
- -blob <chat blob> (the unique blob of the group chat that you wish for the bot to monitor, you can get this by typing /get uri into a chat)
- -datadir <path> (an absolute path where data the log files and the users.xml file will be saved, for example C:\GC Skype Data\)
Make sure you include the trailing backslash on the path, otherwise it might wreck some havoc, I’ll commit and push a fix for that later to the repository.
Thanks for reading.