I'm just messing around with the skype4com api in c# and I'm a bit confused on how to mute skype with the api. I get an error on the line "skype.Mute = true;"
error:
Error 1 Ambiguity between 'SKYPE4COMLib.ISkype.Mute' and 'SKYPE4COMLib._ISkypeEvents_Event.Mute' C:\Users\derp\documents\visual studio 2010\Projects\SkypeBot\SkypeBot\Form1.cs 33 39 SkypeBot
code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SKYPE4COMLib;
namespace SkypeBot
{
public partial class Form1 : Form
{
public Skype skype = new Skype();
public bool afk;
public Form1()
{
InitializeComponent();
((_ISkypeEvents_Event)skype).MessageStatus += OnMessageStatus;
skype.Attach(8);
}
void OnMessageStatus(ChatMessage msg, TChatMessageStatus status)
{
if (status.ToString() == "cmsSending" && msg.Sender.DisplayName == skype.CurrentUser.DisplayName)
{
if (msg.Body == "!afk")
{
afk = !afk;
if (afk)
{
msg.Body = msg.Sender.FullName + " is now afk!";
the following line is the issue:
skype.Mute = true;
}
else
{
msg.Body = msg.Sender.FullName + " has returned!";
}
}
}
}
}
}
((ISkype)skype).Mute = true;
? – Simon Whitehead