Class: Discorb::Command::Command::SubcommandGroup
- Inherits:
-
GroupCommand
- Object
- DiscordModel
- Discorb::Command::Command
- GroupCommand
- Discorb::Command::Command::SubcommandGroup
- Defined in:
- lib/discorb/command.rb
Overview
Represents the subcommand group.
Instance Attribute Summary collapse
-
#commands ⇒ Array<Discorb::Command::Command::SlashCommand>
readonly
The subcommands of the command.
Attributes inherited from GroupCommand
Attributes inherited from Discorb::Command::Command
#block, #guild_ids, #id_map, #name, #type, #type_raw
Instance Method Summary collapse
-
#slash(command_name, description, options = {}, enabled: true, &block) ⇒ Discorb::Command::Command::SlashCommand
Add new subcommand.
- #to_s ⇒ Object
Methods inherited from GroupCommand
Methods inherited from DiscordModel
Instance Attribute Details
#commands ⇒ Array<Discorb::Command::Command::SlashCommand> (readonly)
Returns The subcommands of the command.
361 362 363 |
# File 'lib/discorb/command.rb', line 361 def commands @commands end |
Instance Method Details
#slash(command_name, description, options = {}, enabled: true, &block) ⇒ Discorb::Command::Command::SlashCommand
Add new subcommand.
380 381 382 383 384 |
# File 'lib/discorb/command.rb', line 380 def slash(command_name, description, = {}, enabled: true, &block) command = Discorb::Command::Command::SlashCommand.new(command_name, description, , [], enabled, block, 1, @parent + " " + @name) @commands << command command end |
#to_s ⇒ Object
371 372 373 |
# File 'lib/discorb/command.rb', line 371 def to_s @parent + " " + @name end |