2014-05-31 01:59:03 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.ChatBots
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Example of message receiving.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public class TestBot : ChatBot
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void GetText(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
string message = "";
|
|
|
|
|
|
string username = "";
|
2015-06-20 22:58:18 +02:00
|
|
|
|
text = GetVerbatim(text);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
|
2015-06-20 22:58:18 +02:00
|
|
|
|
if (IsPrivateMessage(text, ref message, ref username))
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
2018-05-08 19:27:19 +02:00
|
|
|
|
LogToConsole("Bot: " + username + " told me : " + message);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
2015-06-20 22:58:18 +02:00
|
|
|
|
else if (IsChatMessage(text, ref message, ref username))
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
2018-05-08 19:27:19 +02:00
|
|
|
|
LogToConsole("Bot: " + username + " said : " + message);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|