Class: Botiasloop::Commands::Help
- Defined in:
- lib/botiasloop/commands/help.rb
Overview
Help command - displays available slash commands
Instance Method Summary collapse
-
#execute(context, _args = nil) ⇒ String
Execute the help command.
Methods inherited from Base
command, description, inherited
Instance Method Details
#execute(context, _args = nil) ⇒ String
Execute the help command
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/botiasloop/commands/help.rb', line 15 def execute(context, _args = nil) commands = Botiasloop::Commands.registry.all lines = ["**Available commands**"] commands.each do |cmd_class| name = cmd_class.command_name desc = cmd_class.description || "No description" lines << "/#{name} - #{desc}" end lines.join("\n") end |