Class: Discorb::Message::Interaction

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

Overview

Represents a interaction of message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#id -> Discorb::Snowflake (readonly)

Returns The interaction ID.

Returns:



124
125
126
# File 'lib/discorb/message_meta.rb', line 124

def id
  @id
end

#name -> String? (readonly)

Returns:

  • (String)

    The name of command.

  • (nil)

    If the message is not a command.



127
128
129
# File 'lib/discorb/message_meta.rb', line 127

def name
  @name
end

#type -> Class (readonly)

Returns The type of interaction.

Returns:

  • (Class)

    The type of interaction.



129
130
131
# File 'lib/discorb/message_meta.rb', line 129

def type
  @type
end

#user -> Discorb::User (readonly)

Returns The user.

Returns:



131
132
133
# File 'lib/discorb/message_meta.rb', line 131

def user
  @user
end

Instance Method Details

#inspect -> Object



147
148
149
# File 'lib/discorb/message_meta.rb', line 147

def inspect
  "<#{self.class.name} #{@id}: #{@name} type=#{@type} #{@user}>"
end