class Discorb::Command::Command::SubcommandGroup
Represents the subcommand group.
Attributes
commands[R]
@return [Array<Discorb::Command::Command::SlashCommand>] The subcommands of the command.
Public Class Methods
new(name, description, parent, client)
click to toggle source
@!visibility private
Calls superclass method
Discorb::Command::Command::GroupCommand::new
# File lib/discorb/command.rb, line 339 def initialize(name, description, parent, client) super(name, description, [], 1, client) @commands = [] @parent = parent end
Public Instance Methods
slash(command_name, description, options = {}, &block)
click to toggle source
Add new subcommand. @param (see Discorb::Command::Handler#slash
) @return [Discorb::Command::Command::SlashCommand] The added subcommand.
# File lib/discorb/command.rb, line 355 def slash(command_name, description, options = {}, &block) command = Discorb::Command::Command::SlashCommand.new(command_name, description, options, [], block, 1, @parent + " " + @name) @commands << command @client.bottom_commands << command command end
to_s()
click to toggle source
# File lib/discorb/command.rb, line 346 def to_s @parent + " " + @name end