1 class HelpPlugin < PluginBase
2 def self.cmd_help(socket, sender, isprivate, args)
3 socket.sendPrivateMessage(sender, "Available commands are:")
4 PluginBase.commands.each do |cmd|
5 message = "#{CMD_PREFIX}#{cmd}"
6 if PluginBase.has_command_help?(cmd) then
7 arghelp, cmdhelp = PluginBase.command_help(cmd).call()
8 message << " #{arghelp}" unless arghelp.nil? or arghelp.empty?
9 message << " - #{cmdhelp}"
10 socket.sendPrivateMessage(sender, " #{message}")
15 def self.cmd_help_help
16 [nil, "Displays this help"]
19 def self.cmd_about(socket, sender, isprivate, args)
21 I am a Direct Connect bot written in Ruby.
22 I was written by Kevin Ballard <kevin@sb.org>.
23 My code is available at http://repo.or.cz/w/dcbot.git
25 about.split("\n").each do |line|
26 socket.sendPrivateMessage(sender, line)
30 def self.cmd_about_help
31 [nil, "Displays information about this bot"]