Sha256: 54d368038cd966539f9da09afa56d95169c3ea1234c6fea6733f5e2e2a933d3f

Contents?: true

Size: 642 Bytes

Versions: 20

Compression:

Stored size: 642 Bytes

Contents

core.help_add('help', 'help', 'help {commands}', 'Shows help for given commands')
cmd(cmd: 'help') do |dat|
  if dat[:split].empty?
    dat.nreply(help_render)
  else
    dat[:split].each do |i|
      dat.nreply(help_render(i, dat))
    end
  end
end

core.help_add('help', 'list', 'list {groups}', 'Lists groups or items in groups')
cmd(cmd: 'list') do |dat|
  if dat[:split].empty?
    dat.nreply "%BGroups%N: #{@help.keys.join(', ')}"
  else
    dat[:split].each do |i|
      if @help[i]
        dat.nreply "Items in %B#{i}%N: #{@help[i].keys.join(', ')}"
      else
        dat.nreply "No such group: %B#{i}%N"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.6 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.5 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.4 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.3 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.2 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.1 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.3.0 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.7 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.6 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.5 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.4 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.3 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.2 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.1 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.2.0 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.1.3 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.1.2 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.1.1 lib/protonbot/core_plugin/commands/help.rb
protonbot-0.1.0 lib/protonbot/core_plugin/commands/help.rb