removes the pointless smart reply vaildation
This commit is contained in:
parent
6760f18fa6
commit
dea834a427
1 changed files with 24 additions and 38 deletions
|
|
@ -135,13 +135,9 @@ namespace BSB.Commands
|
||||||
|
|
||||||
public bool SmartCommandReply(string target, string output)
|
public bool SmartCommandReply(string target, string output)
|
||||||
{
|
{
|
||||||
return SmartCommandReply(target, output, "", false);
|
return SmartCommandReply(target, output, "");
|
||||||
}
|
}
|
||||||
public bool SmartCommandReply(string target, string output, string command)
|
public bool SmartCommandReply(string target, string output, string command)
|
||||||
{
|
|
||||||
return SmartCommandReply(target, output, command, false);
|
|
||||||
}
|
|
||||||
public bool SmartCommandReply(string target,string output,string command,bool vaildate_only)
|
|
||||||
{
|
{
|
||||||
string mode = "CHAT";
|
string mode = "CHAT";
|
||||||
UUID target_avatar = UUID.Zero;
|
UUID target_avatar = UUID.Zero;
|
||||||
|
|
@ -158,52 +154,42 @@ namespace BSB.Commands
|
||||||
{
|
{
|
||||||
int.TryParse(target, out target_channel);
|
int.TryParse(target, out target_channel);
|
||||||
}
|
}
|
||||||
if (vaildate_only == false)
|
|
||||||
|
if (mode == "CHAT")
|
||||||
{
|
{
|
||||||
if (mode == "CHAT")
|
bot.GetClient.Self.Chat(output, target_channel, ChatType.Normal);
|
||||||
{
|
}
|
||||||
bot.GetClient.Self.Chat(output, target_channel, ChatType.Normal);
|
else if (mode == "IM")
|
||||||
}
|
{
|
||||||
else if (mode == "IM")
|
bot.GetClient.Self.InstantMessage(target_avatar, output);
|
||||||
{
|
}
|
||||||
bot.GetClient.Self.InstantMessage(target_avatar, output);
|
else if (mode == "HTTP")
|
||||||
}
|
{
|
||||||
else if (mode == "HTTP")
|
Dictionary<string, string> values = new Dictionary<string, string>
|
||||||
{
|
|
||||||
Dictionary<string, string> values = new Dictionary<string, string>
|
|
||||||
{
|
{
|
||||||
{ "reply", output },
|
{ "reply", output },
|
||||||
{ "unixtime", helpers.UnixTimeNow().ToString() }
|
{ "unixtime", helpers.UnixTimeNow().ToString() }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (command != "")
|
if (command != "")
|
||||||
{
|
|
||||||
values.Add("command", command);
|
|
||||||
}
|
|
||||||
var content = new FormUrlEncodedContent(values);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
HTTPclient.PostAsync(target, content);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
ConsoleLog.Crit("[SmartReply] HTTP failed: " + e.Message + "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return false;
|
values.Add("command", command);
|
||||||
|
}
|
||||||
|
var content = new FormUrlEncodedContent(values);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HTTPclient.PostAsync(target, content);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
ConsoleLog.Crit("[SmartReply] HTTP failed: " + e.Message + "");
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((mode == "CHAT") || (mode == "IM") || (mode == "HTTP"))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<string> suppress_warnings = new List<string>();
|
protected List<string> suppress_warnings = new List<string>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue