2014-05-31 01:59:03 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.ChatBots
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allow to perform operations using whispers to the bot
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public class RemoteControl : ChatBot
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void GetText(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
text = getVerbatim(text);
|
|
|
|
|
|
string command = "", sender = "";
|
|
|
|
|
|
if (isPrivateMessage(text, ref command, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
|
|
|
|
|
|
{
|
2014-06-14 18:48:43 +02:00
|
|
|
|
string response = "";
|
|
|
|
|
|
performInternalCommand(command, ref response);
|
|
|
|
|
|
if (response.Length > 0)
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
2014-06-14 18:48:43 +02:00
|
|
|
|
SendPrivateMessage(sender, response);
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2014-08-28 15:12:58 +02:00
|
|
|
|
else if (Settings.RemoteCtrl_AutoTpaccept && isTeleportRequest(text, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
|
2014-06-14 13:51:30 +02:00
|
|
|
|
{
|
|
|
|
|
|
SendText("/tpaccept");
|
|
|
|
|
|
}
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|