Class: RubyCord::Command::SubCommand
- Inherits:
-
GroupCommand
- Object
- DiscordModel
- RubyCord::Command
- GroupCommand
- RubyCord::Command::SubCommand
- Defined in:
- lib/rubycord/command/sub_command.rb
Constant Summary
Constants inherited from RubyCord::Command
Instance Attribute Summary collapse
-
#commands ⇒ Array<RubyCord::Command::SlashCommand>
readonly
The subcommands of the command.
Attributes inherited from GroupCommand
Attributes inherited from RubyCord::Command
#block, #default_permission, #dm_permission, #guild_ids, #name, #type, #type_raw
Instance Method Summary collapse
-
#slash(command_name, description, options = {}, &block) ⇒ RubyCord::Command::SlashCommand
Add new subcommand.
- #to_s ⇒ Object
Methods inherited from GroupCommand
Methods inherited from RubyCord::Command
Methods inherited from DiscordModel
Instance Attribute Details
#commands ⇒ Array<RubyCord::Command::SlashCommand> (readonly)
Returns The subcommands of the command.
8 9 10 |
# File 'lib/rubycord/command/sub_command.rb', line 8 def commands @commands end |
Instance Method Details
#slash(command_name, description, options = {}, &block) ⇒ RubyCord::Command::SlashCommand
Add new subcommand.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rubycord/command/sub_command.rb', line 34 def slash(command_name, description, = {}, &block) command = RubyCord::Command::SlashCommand.new( command_name, description, , [], block, 1, self, nil, nil ) @commands << command @client.callable_commands << command command end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/rubycord/command/sub_command.rb', line 25 def to_s "#{@parent} #{@name}" end |