This is what I have been looking for as I can do a bot that responds when I receive a message from someone, I found a tutorial but I could not get the bot to respond even though the bot answered in the tutorial.
This is the code I have for the bot to respond.
public void MsgStatus(ChatMessage pMessage, TChatMessageStatus Status)
{
if (Status == TChatMessageStatus.cmsReceived || Status == TChatMessageStatus.cmsSent)
{
string msg = pMessage.Body;
Chat c = pMessage.Chat;
if (msg.StartsWith(Trigger))
{
ListBox.Items.Add(DateTime.Now.ToLongTimeString() + ":" + "command" + "'" + msg + "'" + "from" + pMessage.Sender.Handle);
msg = msg.Remove(0, 1).ToLower();
}
if (msg == Trigger + "help")
{
c.SendMessage("working");
}
else if (msg == "hello")
{
c.SendMessage("hello");
}
else if (msg == "oi" || msg == "ola" || msg == "olá")
{
c.SendMessage("Oi");
}
}
}
That's how it starts
oSkype.MessageStatus += new SKYPE4COMLib._ISkypeEvents_MessageStatusEventHandler(MsgStatus);