Simple bot for Skype on C ++ Qt (ActiveX)

    Hello! Recently, from boredom, I wrote a Skype bot. I decided to share it, maybe the source codes will be useful to someone, and the bot itself.


    In the post, I will not bore you with stories about the code, since in the source you can clearly see and understand what's what by the names of variables, classes, methods and comments.

    The program has some features:
    • Connect to Skype COM Server
    • Disconnect from the Skype COM server
    • Skype launch
    • Skype Closings
    • Dictionary updates without restarting the Dictionary-> Reread program
    • The choice of chats in which there will be a dialogue "Chats-> Chat list"
    • Collapses in the system tray

    For the program to work, you need the config.xml file, which must be in the same directory as the exe program.

    Configure Skype Bot

    To save the settings, you need the config.xml file, which should be in the same directory as SkypeBot.exe. This file contains both the dictionary for the bot and its settings:

    The structure of config.xml is as follows:

    ПриветЗдороваХайНормально, у тебя как?Хорошо#cj1900/$e9e3e97f93c86546

    The t tag contains a key to which the bot and the answers themselves will give an answer.
    The key is stored in the tag attribute t and is called reg . Inside the reg tag are words enclosed in brackets and written using the | . When someone writes messages in a chat, the bot finds one of the words in the key and, if there is a match, answers it with a random phrase of prisoners with the reply tag .

    There can be as many keys as there are answers.

    Next comes the namechat tag . The chat name is stored there, it is edited by the program itself, it contains the name of the chat rooms in which you want to conduct a dialogue with the bot.

    Here is the chat selection window:


    Unfortunately, for some reason Skype does not always show all chats via ActiveX, I still could not solve this problem.

    File links

    Link to source on
    Link to source on
    Link to SkypeBot program
    The only detailed documentation for SkypeApi written for visual basic

    Also popular now: