简体   繁体   中英

Send message to skype group using Skype4com(C#)

I'm creating a aplication in .NET(C# - WinForms) to send a automatic answer to my skype new messages, but I got a issue. My code that send de message is this:

private void Form1_Load(object sender, EventArgs e)
        {            
            skype = new Skype();

            skype.Attach(7, true);
            profileName.Text = skype.CurrentUser.FullName;
            temporizador.Start();
            picOffline.Visible = false;
            picOnline.Visible = false;


            temporizador.Start();
            picOffline.Visible = false;
            picOnline.Visible = false;

            //Monitor
            skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(skypeId_MessageStatus);

        }

and the method that will answer is this:

public void skypeId_MessageStatus (IChatMessage msg, TChatMessageStatus status)
        {
           if(status == TChatMessageStatus.cmsReceived)
            {
                Thread.Sleep(5000);
                try
                {
                    skype.SendMessage(msg.FromHandle, resp);
                    //msg.Chat.SendMessage(resp);
                    msg.Seen = true;
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.ToString());
                }
            }
        }

My problem is that the app isn't answering group chat, only a single contact new message. Using this library how can identify new group message and auto-reply they.

You can use the line you commented out, which is

msg.Chat.SendMessage(resp);

This should work, as I just ran into this problem today. You can also get rid of the line

skype.SendMessage(msg.FromHandle, resp);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM