Support multiple channels
[reactos.git] / irc / TechBot / TechBot.Library / HelpCommand.cs
1 using System;
2 using System.Collections;
3
4 namespace TechBot.Library
5 {
6 public class HelpCommand : BaseCommand, ICommand
7 {
8 private IServiceOutput serviceOutput;
9 private ArrayList commands;
10
11 public HelpCommand(IServiceOutput serviceOutput,
12 ArrayList commands)
13 {
14 this.serviceOutput = serviceOutput;
15 this.commands = commands;
16 }
17
18 public bool CanHandle(string commandName)
19 {
20 return CanHandle(commandName,
21 new string[] { "help" });
22 }
23
24 public void Handle(MessageContext context,
25 string commandName,
26 string parameters)
27 {
28 serviceOutput.WriteLine(context,
29 "I support the following commands:");
30 foreach (ICommand command in commands)
31 {
32 serviceOutput.WriteLine(context,
33 command.Help());
34 }
35 }
36
37 public string Help()
38 {
39 return "!help";
40 }
41 }
42 }