What to do if a bot appears on Skype. Set Skype statuses according to your personal needs

Following some other instant messengers and social services, Skype also decided to “legalize” bots. And at the end of March 2016, the developers announced this function in your application. What is it intended for? Skype bot, why, in fact, can it be useful to the most ordinary user and how can you add some kind of bot to yourself?

Bots in virtual space

In fact, bots are not an invention of modern virtual space. The bot is computer program, which is designed to “pretend” in every possible way an ordinary person online. And the first bots, oddly enough, arose... in computer games. It was with the development of online shooters - such as DOOM, Quake and the like - that users began to write so-called bots - software robots that could keep company in online battles. After all, not all players then had access to computer network, but I still wanted to play...

Today, bots are both pleasant and unpleasant additions to almost any social network or messenger.

At first they only irritated me with their stupidity. Over time, however, programmers realized that bots could also be used to provide useful service to humanity. And now a large number of bots are written to order and to on a paid basis. For example, to answer customer questions, issue information about keywords in messenger...

Assigning bots in Skype

The Skype software robot can somehow imitate the online behavior of a living person. Since its announcement, a variety of Skype bots have appeared. Some simply entertain the user by playing with him various games, others may search useful information on the Internet, others can chat...

In short, the choice is really great. However, most of bots are still functioning on English language, some are available only in the United States. However, there are fewer and fewer restrictions.

To make sure your bot is safe, you need to look at its profile before adding it. This should contain the phrase “Skype Certified”. In addition, the bot's avatar always has a hexagonal shape, while for all other users it is round. In addition, next to the avatar of the approved bot there is a “tick” on a gray background.

How can you add this or that bot? It's quite simple. For this:

  1. You need to download Skype on your device;
  2. Further actions depend on what operating system Skype works. For example, on Android there is a special menu item "Contacts". That's what it's called - "Bots". In iOS there is a Bots icon in the tab "Recent". The desktop version of Skype Windows has a special icon in the side toolbar. In the browser version of Skype you need to select "Bot Review";
  3. Next, all you have to do is click on "Add bot" or "Begin".

A list of certified and approved bots can be found on the project page: https://support.skype.com/ru/faq/FA34655/dostupnye-boty-skype.

If the bot is boring or suspicious, you can block or delete it. This is done in exactly the same way as with the most common contacts on Skype.

It remains to add that bots are available only in the latest release versions of Skype. So it makes sense to update the program from official sources.

Knowing Skype bots- what is it, you can significantly expand your ability to use this multilateral program for communication and calls.

A user can be added to your Skype account under various nicknames. Typically, one of his first messages is something like this:

hey i found your name on the directory. I"m 24/female wanna chat and share pics?

Then she says that her name is Amanda and she is from Miami. Correspondence is conducted only in English, even if you answer her in Russian. This skype bot. You won't get clear answers from her. The links it provides can, in principle, be opened; they do not pose any potential threats. But you still shouldn’t enter your bank card number on websites (unless you really want to watch paid video chats).

I am attaching the entire correspondence:

Whoopie.kind25:hi

Evgeniy Yu.: Hello! Who is this? What they wanted?

Whoopie.kind25: hey i found your name on the directory. I"m 24/female wanna chat and share pics?

Evgeniy Yu.: ok, you can

Evgeniy Yu.: from Belarus, and you?

Evgeniy Yu.: ok

Whoopie.kind25: cool, im just bored as fuk at home! I"m single and looking... have you ever had cyber sex?

Evgeniy Yu.: no

Whoopie.kind25: lol, send me a recent pic of you and lets have some fun

Evgeniy Yu.: you should first

Whoopie.kind25: sweet like want to see pics of me?

Evgeniy Yu.: yes

Evgeniy Yu.: good

Whoopie.kind25: talk to me like a slut baby... do you like girls with big tits? want to see some naughty big tit pics?

Evgeniy Yu.: yes

Evgeniy Yu.: give me more than one plz

Whoopie.kind25: i"m getting wet baby wanna watch me rub my pussy on my cam!?

Evgeniy Yu.: no, give me plz more photos

Evgeniy Yu.: give me plz more photos

Whoopie.kind25: Don"t worry baby the site i"m on is FREE to join this site all you have to do is register they support mobile phones too:)

Evgeniy Yu.: How old are you?

Whoopie.kind25: fill out your cc info baby for Age verification ONLY, your card will not be charged. ok i"m ready for u now

Evgeniy Yu.: > whoopie.kind25: ok i"ll show you just 1 naughty pic... http://i.imgur.com/zRAM2Uu.jpg

Give me plz more naughty pics

Evgeniy Yu.: what about more photos?

Evgeniy Yu.: i wait for your photos

Whoopie.kind25:k

Another correspondence:

Applesauce.bunny562: hey

Evgeniy Yu.: hello, who are you?

Applesauce.bunny562: hey i found your name on the directory. I"m 24/female wanna chat and share pics?

Evgeniy Yu.: ok

Evgeniy Yu.: yes

Evgeniy Yu.: i`m from Belarus

Applesauce.bunny562: cool, im just bored as fuk at home! I"m single and looking... have you ever had cyber sex?

Evgeniy Yu.: never have

Evgeniy Yu.: lol, send me a recent pic of you and lets have some fun

Applesauce.bunny562: lol, send me a recent pic of you and lets have some fun

Evgeniy Yu.: sweet like want to see pics of me?

Applesauce.bunny562: sweet like want to see pics of me?

Evgeniy Yu.: angie varona

Talk to me like a slut baby... do you like girls with big tits? want to see some naughty big tit pics?

Applesauce.bunny562: talk to me like a slut baby... do you like girls with big tits? want to see some naughty big tit pics?

Applesauce.bunny562: ok i"ll show you just 1 naughty pic... http://i.imgur.com/SDvojZZ.jpg

Evgeniy Yu.: good

Applesauce.bunny562: i"m getting wet baby wanna watch me rub my pussy on my cam!?

Evgeniy Yu.: yes

Evgeniy Yu.: ok

Applesauce.bunny562: Don"t worry baby the site i"m on is FREE to join this site all you have to do is register they support mobile phones too:)

You can already find a lot of such correspondence on the Internet.

Skype bot Amanda “knocked” on me under the nickname whoopie.kind25, but also under other nicknames:

  • mega_punfs
  • akon4loveguy
  • sparky.lovr69
  • passion.dall62
  • lavonia.berk
  • elegantoffer842
  • applesauce.bunny562
  • and etc.

As you can see, the bot lures you to some sites. To entice her, she says that she has curvaceous figures and big tits**. Then he offers to look at her body through a webcam, but this is already on the site :)

The first link the bot gives leads to a completely harmless imgur site - http://imgur.com/a/PC6Hy. In fact, these are photos of Angie Varona - a girl who became a celebrity thanks to this bot. Photos by Angie Varona:




About launching bots in Skype - it's time to learn how it works. Under the cut - short description possible problems. For those who can't wait to see the result, here it is - MetricsBot.

Bot Framework vs. Skype Bot API

First, you should understand that there is a Bot Framework, which allows you to create bots for many instant messengers, incl. and for Skype, and there is Skype Bot API, which allows you to create bots specifically for Skype. Each has its own documentation, its own bot directory (?) and its own bot registration. It seems obvious that these are different things, but I spent quite a lot of time trying to understand the Bot Framework documentation and registering a bot in it, when I expected that I was creating a bot without a framework. Next we will talk specifically about the Skype Bot API, Bot Framework We don’t need it, we don’t need to register anything there either. There is a Skype SDK for Node.js and for . I didn’t use them either, because I wrote the bot in Python.

useful links

To start small set useful links(all links are in English):
  • Your applications (here you need to create a new application and get the app id and client secret)
  • Managing your bots (here you need to create a new bot, indicating the app id received earlier)
In principle, from the documentation it is clear how the bot works and how it interacts with Skype, so I will not describe this part - I will tell you about the difficulties.

Authorization

This turned out to be the most time consuming part for me. The documentation says that to authorize you need to obtain a token and then use it in the HTTP header on each request:

Authorization: Bearer oauth2-token

However, for some reason, the documentation forgot to indicate which scope should be used to obtain a token. The correct answer (can be found in the Node.js SDK code) is https://graph.microsoft.com/.default.
But here the most interesting thing begins - if you create a URL for confirmation by the user (= the owner of the bot), then receive auth_code, and then try to exchange this code for access token, then the problem will arise at the very first step - when opening the created URL, Microsoft complains about the wrong scope. The correct scope, by the way, is not in the list possible options in the Microsoft documentation. I tried to specify a different scope - openid offline_access https://graph.microsoft.com/user.read , in this case I was able to get a token, but I couldn’t interact with Skype with it.
The solution turned out to be unexpected - to receive an access_token, it was necessary to send a regular POST request:

Curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d "client_id= &client_secret= &grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default" "https://login.microsoftonline.com/common/oauth2/v2.0/token"

Returns in response access_token And expires_in(without any refresh_token). I've never seen OAuth like this before.

Sending messages

Sending messages is quite simple -

POST /v2/conversations/8:alice/activities HTTP/1.1
Host: apis.skype.com
Authorization: Bearer oauth2-token
{
"message": ("content" : "Hi! (wave)")
}

Requests are sent to apis.skype.com. They forgot to indicate in the documentation that requests should be sent via http s.
You can use html tags in the text. Exactly which ones are still unknown (there is no list in the documentation).
There are interesting and undescribed restrictions on the text you send. For example, you cannot use the symbols in the text & , < And > . Inability to transmit symbol & creates a problem when passing links. Another problem when transferring links is automatically generated previews for each link. In my bot MetricsBot there are three links in the invitation text, Skype creates three previews. There is no way to disable this yet.

Publishing a bot

After creating the bot, you can try to publish it (before this, the number of users of the bot is limited - only 100 people can use it). How long the publication process takes is not clear; this is not in the documentation. My bot has not yet been published. On the official forum, my question on this topic is ignored (although Microsoft employees answer my other questions).
Please note that to publish a bot, you must disable the use of the bot in group chats.

Otherwise, creating a bot for Skype is quite simple.

About my bot for Telegram, which can show data from Google Analytics. And then Microsoft announced the launch of bots in Skype - it’s time to learn how it works. Below the cut is a short description of possible problems. For those who can't wait to see the result, here it is - MetricsBot.

Bot Framework vs. Skype Bot API

First, you should understand that there is a Bot Framework, which allows you to create bots for many instant messengers, incl. and for Skype, and there is Skype Bot API, which allows you to create bots specifically for Skype. Each has its own documentation, its own bot directory (?) and its own bot registration. It seems obvious that these are different things, but I spent quite a lot of time trying to understand the Bot Framework documentation and registering a bot in it, when I expected that I was creating a bot without a framework. Next we will talk specifically about the Skype Bot API, Bot Framework We don’t need it, we don’t need to register anything there either. There is a Skype SDK for Node.js and for . I didn’t use them either, because I wrote the bot in Python.

useful links

First, a small set of useful links (all links are in English):

  • Your applications (here you need to create a new application and get the app id and client secret)
  • Managing your bots (here you need to create a new bot, indicating the app id received earlier)

In principle, from the documentation it is clear how the bot works and how it interacts with Skype, so I will not describe this part - I will tell you about the difficulties.

Authorization

This turned out to be the most time consuming part for me. The documentation says that to authorize you need to obtain a token and then use it in the HTTP header on each request:

Authorization: Bearer oauth2-token

However, for some reason, the documentation forgot to indicate which scope should be used to obtain a token. The correct answer (can be found in the Node.js SDK code) is https://graph.microsoft.com/.default.
But here the most interesting thing begins - if you create a URL for confirmation by the user (= the owner of the bot), then receive auth_code, and then try to exchange this code for access token, then the problem will arise at the very first step - when opening the created URL, Microsoft complains about the wrong scope. The correct scope, by the way, is not in the list of possible options in the Microsoft documentation. I tried to specify a different scope - openid offline_access https://graph.microsoft.com/user.read , in this case I was able to get a token, but I couldn’t interact with Skype with it.
The solution turned out to be unexpected - to receive an access_token, it was necessary to send a regular POST request:

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d "client_id= &client_secret= &grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default" "https://login.microsoftonline.com/common/oauth2/v2.0/token"

Returns in response access_token And expires_in(without any refresh_token). I've never seen OAuth like this before.

Sending messages

Sending messages is quite simple -

POST /v2/conversations/8:alice/activities HTTP/1.1
Host: apis.skype.com
Authorization: Bearer oauth2-token
{
"message": ("content" : "Hi! (wave)")
}

Requests are sent to apis.skype.com. They forgot to indicate in the documentation that requests should be sent via http s.
You can use html tags in the text. Exactly which ones are still unknown (there is no list in the documentation).
There are interesting and undescribed restrictions on the text you send. For example, you cannot use the symbols in the text & , < And > . Inability to transmit symbol & creates a problem when passing links. Another problem when transferring links is automatically generated previews for each link. In my bot MetricsBot there are three links in the invitation text, Skype creates three previews. There is no way to disable this yet.

Publishing a bot

After creating the bot, you can try to publish it (before this, the number of users of the bot is limited - only 100 people can use it). How long the publication process takes is not clear; this is not in the documentation. My bot has not yet been published. On the official forum, my question on this topic is ignored (although Microsoft employees answer my other questions).
Please note that to publish a bot, you must disable the use of the bot in group chats.

Otherwise, creating a bot for Skype is quite simple.

I have long wanted to try to write some simple bot to understand this process. Now I'm on vacation and I have enough free time to start writing for fun in this direction...

I decided to start with a simple bot that can only work with text. The bot will be based on the recently announced bot platform from Microsoft (Microsoft Bot Framework). I liked it because theoretically, one implemented bot can work for Skype and Telegram and the web and many other options. In order not to write a completely useless application, I will make an assistant bot for the developer that can perform actions such as:

  • Converting a string to uppercase
  • Converting a string to lowercase
  • Getting a new Guid
  • Converting a number from any number system to any
  • Converting Base64 strings to plain text
  • Plain text to Base64 string
  • Get date from string in UNIX format
  • Convert date to UNIX format
  • Generate a password of a given length

For such actions, I usually write snippets that are convenient to use if necessary. I use LINQPad to organize and run them. But sometimes I can do something not on my computer or even from a smartphone, in which case my bot can be useful. If you have any other ideas about what functionality can be added to this bot, write to me, I’ll be happy to implement them...

The bot will receive a string as input. We will separate the command and its parameters with spaces. The command itself will be either up to the first space, or the entire line if there are no spaces.

I will not describe the process of processing commands and how they are executed, since everything is extremely simple, and I will publish all the written code on GitHub.

Let's move on to something more interesting, namely, creating the bot itself. To work you need Visual Studio 2015, I recommend installing the available updates. Let's take advantage ready-made template to create bots “Bot Application template”, you can download it from this link aka.ms/bf-bc-vstemplate

The resulting zip archive must be copied to the directory " %USERPROFILE%\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#"After this, we can already create a new bot from this template.

Immediately after creation, the project has following structure

We can run it and check what it can already do. For testing there is a separate application “Bot Framework Emulator”, you can find it from here http://download.botframework.com/botconnector/tools/emulator/publish.htm

Let's launch our application and emulator.

By default, the bot can return the length of the received message; this functionality is implemented in MessagesController:


Now I’ll add the previously described functionality to the bot. For this I will add new project“DeveloperToolsPack” which will be a Class Library and I will also add a project for Unit tests.

The DeveloperTools class is as follows:

Public class DeveloperTools ( private Dictionary _tools; public DeveloperTools() ( AddTool(new ToUpper()); AddTool(new ToLower()); AddTool(new NewGuid()); AddTool(new ConvertTo()); AddTool(new FromBase64()); AddTool(new ToBase64( )); AddTool(new FromUnixTime()); AddTool(new ToUnixTime()); AddTool(new Password()); ) private void AddTool(ITool tool) ( if (_tools == null) ( _tools = new Dictionary (); ) if (!_tools.ContainsKey(tool.CommandName.ToLower())) ( _tools.Add(tool.CommandName.ToLower(), tool); ) ) public string Run(string str) ( if (!System.String. IsNullOrEmpty(str)) ( str = str.Trim(); var indexOfSpace = str.IndexOf(" ", StringComparison.Ordinal); string command; var commandText = ""; if (indexOfSpace != -1) ( command = str .Substring(0, indexOfSpace).ToLower(); commandText = str.Substring(indexOfSpace+1, str.Length - indexOfSpace-1); ) else ( command = str.ToLower(); ) if (_tools.ContainsKey(command )) ( return _tools.Run(commandText); ) else ( if (command == "help") ( var returnString = new StringBuilder(); foreach (var tool in _tools) ( returnString.Append(tool.Value.Description + "\n\r"); ) return returnString.ToString(); ) return $"Command \"**(command)**\" not found. See \"**help**\" command."; ) ) return "Please input a string"; ) )

In the bot itself, in the “MessagesController” we will replace the processing of the received message with

Var developerTools = new DeveloperToolsPack.DeveloperTools(); return message.CreateReplyMessage(developerTools.Run(message.Text));

You can run and test this bot.


If everything works as it should, you can go directly to publication. Let's create a regular web application in Azure; you can use the free tariff, since there is enough power for testing.

Now right-click on the project and select Publish

Now you need to select "Microsoft Azure Web Apps"


And find the previously created application there. After this, you can click the “Publish” button and the application will be published.

Undoubtedly, bots are very promising direction. The Microsoft platform is very convenient and allows you to integrate with other services, which is undoubtedly a huge plus. The created bots, of course, are not limited to just text processing; they can do much more complex functions. In this article, I showed how you can make a simple, but at the same time useful bot for Skype and publish it. The created bot, among other things, can work on many other platforms, such as Telegram, Facebook Messenger, GroupMe, Slack.

Happy programming.

P.S. The bot code was changed under new version Bot Framework