mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 18:02:55 +00:00
![Marc Piulachs](/assets/img/avatar_default.png)
* remove old outdated SD project files * make it use some .NET 2.0 features as generic collections and settings svn path=/trunk/; revision=31130
51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using System;
|
|
|
|
namespace TechBot.Library
|
|
{
|
|
public abstract class BugCommand : Command//, ICommand
|
|
{
|
|
public BugCommand(TechBotService techBot) : base (techBot)
|
|
{
|
|
}
|
|
|
|
public override void Handle(MessageContext context,
|
|
string commandName,
|
|
string parameters)
|
|
{
|
|
string bugText = parameters;
|
|
if (bugText.Equals(String.Empty))
|
|
{
|
|
TechBot.ServiceOutput.WriteLine(context,
|
|
"Please provide a valid bug number.");
|
|
return;
|
|
}
|
|
|
|
NumberParser np = new NumberParser();
|
|
long bug = np.Parse(bugText);
|
|
if (np.Error)
|
|
{
|
|
TechBot.ServiceOutput.WriteLine(context,
|
|
String.Format("{0} is not a valid bug number.",
|
|
bugText));
|
|
return;
|
|
}
|
|
|
|
/*
|
|
string bugUrl = this.RosBugUrl;
|
|
|
|
if (context is ChannelMessageContext)
|
|
{
|
|
ChannelMessageContext channelContext = context as ChannelMessageContext;
|
|
if (channelContext.Channel.Name == "winehackers")
|
|
bugUrl = this.WineBugUrl;
|
|
else if (channelContext.Channel.Name == "samba-technical")
|
|
bugUrl = this.SambaBugUrl;
|
|
}*/
|
|
|
|
TechBot.ServiceOutput.WriteLine(context, String.Format(BugUrl, bug));
|
|
}
|
|
|
|
protected abstract string BugUrl { get; }
|
|
}
|
|
}
|