Class: Plugins::BotHelp
- Inherits:
-
Object
- Object
- Plugins::BotHelp
- Includes:
- Cinch::Helpers, Cinch::Plugin
- Defined in:
- lib/Zeta/plugins/help.rb
Instance Method Summary collapse
Methods included from Cinch::Plugin
Instance Method Details
#execute_help(m, name) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/Zeta/plugins/help.rb', line 13 def execute_help(m, name) list = {} @bot.plugins.each { |p| list[p.class.plugin_name.downcase] = {name: p.class.plugin_name, help: p.class.help} }; return m.user.notice("Help for \"#{name}\" could not be found.") unless list.has_key?(name.downcase) m.user.notice("Help for #{Format(:bold, list[name.downcase][:name])}:\n#{list[name.downcase][:help]}") end |
#execute_list(m) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/Zeta/plugins/help.rb', line 21 def execute_list(m) list = [] @bot.plugins.each {|p| list << p.class.plugin_name }; m.user.notice("All #{list.size} currently loaded plugins for #{@bot.nick}:\n#{list.to_sentence}.\nTo view help for a plugin, use `!help <plugin name>`.") end |