Browse Source

Fixed extra space in front of first message when splitting message.

Fixed possible null exception when unable to get results from Wolfram Alpha.
pull/15/head
Teknikode 7 years ago
parent
commit
66e4ac1876
  1. 4
      IRCServices/SendCommand.cs
  2. 2
      Modules/Wolfram Alpha/Wolfram_Alpha.cs

4
IRCServices/SendCommand.cs

@ -39,7 +39,7 @@ namespace Combot.IRCServices @@ -39,7 +39,7 @@ namespace Combot.IRCServices
}
subMessage = string.Join(" ", subMessage, splitMessage[i]);
}
SendTCPMessage(string.Format("PRIVMSG {0} :{1}", recipient, subMessage));
SendTCPMessage(string.Format("PRIVMSG {0} :{1}", recipient, subMessage.Remove(0, 1)));
SendPrivateMessage(recipient, nextMessage);
}
else
@ -87,7 +87,7 @@ namespace Combot.IRCServices @@ -87,7 +87,7 @@ namespace Combot.IRCServices
}
subMessage = string.Join(" ", subMessage, splitMessage[i]);
}
SendTCPMessage(string.Format("NOTICE {0} :{1}", recipient, subMessage));
SendTCPMessage(string.Format("NOTICE {0} :{1}", recipient, subMessage.Remove(0, 1)));
SendNotice(recipient, nextMessage);
}
else

2
Modules/Wolfram Alpha/Wolfram_Alpha.cs

@ -41,7 +41,7 @@ namespace Combot.Modules.Plugins @@ -41,7 +41,7 @@ namespace Combot.Modules.Plugins
string errorMessage = string.Format("Unable to fetch results for \u0002{0}\u000F.", command.Arguments["Query"]);
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, errorMessage);
}
if (xnList.Count > 1)
if (xnList != null && xnList.Count > 1)
{
string queryMessage = string.Format("Result for: {0}", xnList[0]["subpod"]["plaintext"].InnerText);
string resultMessage = xnList[1]["subpod"]["plaintext"].InnerText;

Loading…
Cancel
Save