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 = "";
|
2015-01-27 20:23:59 +01:00
|
|
|
|
if (isPrivateMessage(text, ref command, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower().Trim()))
|
2014-05-31 01:59:03 +02:00
|
|
|
|
{
|
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
|
|
|
|
}
|
|
|
|
|
|
}
|
2015-01-02 22:10:12 +01:00
|
|
|
|
else if (Settings.RemoteCtrl_AutoTpaccept
|
|
|
|
|
|
&& isTeleportRequest(text, ref sender)
|
2015-01-27 20:23:59 +01:00
|
|
|
|
&& (Settings.RemoteCtrl_AutoTpaccept_Everyone || Settings.Bots_Owners.Contains(sender.ToLower().Trim())))
|
2014-06-14 13:51:30 +02:00
|
|
|
|
{
|
|
|
|
|
|
SendText("/tpaccept");
|
|
|
|
|
|
}
|
2014-05-31 01:59:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|