Class: Discorb::ApplicationCommand::Command Abstract

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

Overview

This class is abstract.

Represents a application command.

Direct Known Subclasses

ChatInputCommand, GroupCommand

Defined Under Namespace

Classes: ChatInputCommand, GroupCommand, SubcommandGroup

Instance Attribute Summary collapse

Method Summary

Methods inherited from DiscordModel

#==, #eql?, #inspect

Instance Attribute Details

#block -> Proc (readonly)

Returns The block of the command.

Returns:

  • (Proc)

    The block of the command.



15
16
17
# File 'lib/discorb/app_command/command.rb', line 15

def block
  @block
end

#default_permission -> Discorb::Permission (readonly)

Returns The default permissions for this command.

Returns:



21
22
23
# File 'lib/discorb/app_command/command.rb', line 21

def default_permission
  @default_permission
end

#dm_permission -> Boolean (readonly)

Returns Whether the command is enabled in DMs.

Returns:

  • (Boolean)

    Whether the command is enabled in DMs.



23
24
25
# File 'lib/discorb/app_command/command.rb', line 23

def dm_permission
  @dm_permission
end

#guild_ids -> Array<#to_s> (readonly)

Returns The guild ids that the command is enabled in.

Returns:

  • (Array<#to_s>)

    The guild ids that the command is enabled in.



13
14
15
# File 'lib/discorb/app_command/command.rb', line 13

def guild_ids
  @guild_ids
end

#name -> Hash{String => String} (readonly)

Returns The name of the command.

Returns:

  • (Hash{String => String})

    The name of the command.



11
12
13
# File 'lib/discorb/app_command/command.rb', line 11

def name
  @name
end

#type -> :chat_input, ... (readonly)

Returns The type of the command.

Returns:

  • (:chat_input, :user, :message)

    The type of the command.



17
18
19
# File 'lib/discorb/app_command/command.rb', line 17

def type
  @type
end

#type_raw -> Integer (readonly)

Returns The raw type of the command.

Returns:

  • (Integer)

    The raw type of the command.



19
20
21
# File 'lib/discorb/app_command/command.rb', line 19

def type_raw
  @type_raw
end