2022-10-02 18:31:08 +08:00
|
|
|
|
namespace MinecraftClient.ChatBots
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <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
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
LogToConsoleTranslated("bot.testBot.told", username, 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
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
LogToConsoleTranslated("bot.testBot.said", username, message);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|