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.
tags/3.0.1
Teknikode 4 years ago
parent
commit
66e4ac1876
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      IRCServices/SendCommand.cs
  2. 1
    1
      Modules/Wolfram Alpha/Wolfram_Alpha.cs

+ 2
- 2
IRCServices/SendCommand.cs View File

@@ -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
}
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

+ 1
- 1
Modules/Wolfram Alpha/Wolfram_Alpha.cs View File

@@ -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