mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 03:48:17 +00:00
70350430a5
svn path=/trunk/; revision=13604
43 lines
967 B
C#
43 lines
967 B
C#
using System;
|
|
using System.Collections;
|
|
|
|
namespace TechBot.Library
|
|
{
|
|
public class HelpCommand : BaseCommand, ICommand
|
|
{
|
|
private IServiceOutput serviceOutput;
|
|
private ArrayList commands;
|
|
|
|
public HelpCommand(IServiceOutput serviceOutput,
|
|
ArrayList commands)
|
|
{
|
|
this.serviceOutput = serviceOutput;
|
|
this.commands = commands;
|
|
}
|
|
|
|
public bool CanHandle(string commandName)
|
|
{
|
|
return CanHandle(commandName,
|
|
new string[] { "help" });
|
|
}
|
|
|
|
public void Handle(MessageContext context,
|
|
string commandName,
|
|
string parameters)
|
|
{
|
|
serviceOutput.WriteLine(context,
|
|
"I support the following commands:");
|
|
foreach (ICommand command in commands)
|
|
{
|
|
serviceOutput.WriteLine(context,
|
|
command.Help());
|
|
}
|
|
}
|
|
|
|
public string Help()
|
|
{
|
|
return "!help";
|
|
}
|
|
}
|
|
}
|