Set a message Listener - Skype API

How you can create a message listener and receive messages?


Libraries
using SKYPE4COMLib;

Code Snippet
Skype skype = new Skype();
skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(incommingMessage);

private void incommingMessage(ChatMessage msg, TChatMessageStatus status)
{
    string sender = msg.Sender.Handle; // Skype name of sender!
    string message = msg.Body;         // Message content
    DateTime sendTime = msg.Timestamp; // Time when the sender has sended the message.
}


Implementation

Use the code above to fire a function whenever someone sends a message to the current user. NOTICE: The listener doesn't work perfectly. The problem is a cause of internal issus in the API!





Comments
  • mode_editWrite a comment



  • forumComments




Embed Code

We provide special containers which include the full snippet and a link to this site. So for example when you make a tutorial and you are using code from this site, you can use one of the following snippet embeddings:

Load Preview Get Code Close Preview







    Share
    Rating
    thumb_up 2 thumb_down
    Author
    roboalex

    Download: http://zetru.de

    Tags
    MessageStatus
    Skype
    API
    Listener
    AFK
    Bot



    Informations

    posted on 2016-10-23 00:52:42

    viewed 216 times

    snippet's UUID is 580bedba8eab6

    Similar Snippets