Class: Discorb::ApplicationCommand::Command::SubcommandGroup

Inherits:
GroupCommand show all
Defined in:
lib/discorb/app_command/command.rb

Overview

Represents the subcommand group.

Instance Attribute Summary collapse

Attributes inherited from GroupCommand

#description

Attributes inherited from Discorb::ApplicationCommand::Command

#block, #guild_ids, #id_map, #name, #type, #type_raw

Instance Method Summary collapse

Methods inherited from GroupCommand

#group

Methods inherited from DiscordModel

#==, #eql?, #inspect

Instance Attribute Details

#commands -> Array<Discorb::ApplicationCommand::Command::SlashCommand> (readonly)

Returns The subcommands of the command.

Returns:



296
297
298
# File 'lib/discorb/app_command/command.rb', line 296

def commands
  @commands
end

Instance Method Details

#slash(command_name, description, options = {}, &block) -> Discorb::ApplicationCommand::Command::SlashCommand

Add new subcommand.

Returns:



322
323
324
325
326
327
# File 'lib/discorb/app_command/command.rb', line 322

def slash(command_name, description, options = {}, &block)
  command = Discorb::ApplicationCommand::Command::SlashCommand.new(command_name, description, options, [], block, 1, @parent + " " + @name)
  @commands << command
  @client.bottom_commands << command
  command
end

#to_s -> Object



313
314
315
# File 'lib/discorb/app_command/command.rb', line 313

def to_s
  @parent + " " + @name
end