Support multiple channels

svn path=/trunk/; revision=13604
This commit is contained in:
Casper Hornstrup
2005-02-16 21:07:55 +00:00
parent 6536947239
commit 70350430a5
15 changed files with 251 additions and 109 deletions

View File

@@ -24,13 +24,15 @@ namespace TechBot.Library
new string[] { "winerror" });
}
public void Handle(string commandName,
public void Handle(MessageContext context,
string commandName,
string parameters)
{
string winerrorText = parameters;
if (winerrorText.Equals(String.Empty))
{
serviceOutput.WriteLine("Please provide a valid System Error Code value.");
serviceOutput.WriteLine(context,
"Please provide a valid System Error Code value.");
return;
}
@@ -38,7 +40,8 @@ namespace TechBot.Library
long winerror = np.Parse(winerrorText);
if (np.Error)
{
serviceOutput.WriteLine(String.Format("{0} is not a valid System Error Code value.",
serviceOutput.WriteLine(context,
String.Format("{0} is not a valid System Error Code value.",
winerrorText));
return;
}
@@ -46,13 +49,15 @@ namespace TechBot.Library
string description = GetWinerrorDescription(winerror);
if (description != null)
{
serviceOutput.WriteLine(String.Format("{0} is {1}.",
serviceOutput.WriteLine(context,
String.Format("{0} is {1}.",
winerrorText,
description));
}
else
{
serviceOutput.WriteLine(String.Format("I don't know about System Error Code {0}.",
serviceOutput.WriteLine(context,
String.Format("I don't know about System Error Code {0}.",
winerrorText));
}
}