Class: Discorb::CommandInteraction::MessageMenuCommand
- Inherits:
-
Discorb::CommandInteraction
- Object
- DiscordModel
- Interaction
- Discorb::CommandInteraction
- Discorb::CommandInteraction::MessageMenuCommand
- Defined in:
- lib/discorb/interaction.rb
Overview
Represents a message context menu interaction.
Instance Attribute Summary collapse
-
#target -> Discorb::Message
readonly
The target message.
Attributes inherited from Interaction
#application_id, #id, #member, #token, #type, #user, #version
Instance Method Summary collapse
Methods included from Interaction::SourceResponse
Methods inherited from Interaction
Methods inherited from DiscordModel
Instance Attribute Details
#target -> Discorb::Message (readonly)
Returns The target message.
331 332 333 |
# File 'lib/discorb/interaction.rb', line 331 def target @target end |
Instance Method Details
#_set_data(data) -> Object
333 334 335 336 |
# File 'lib/discorb/interaction.rb', line 333 def _set_data(data) @target = Message.new(@client, data[:resolved][:messages][data[:target_id].to_sym].merge({ guild_id: @guild_id.to_s })) @client.commands.find { |c| c.name == data[:name] && c.type_raw == 3 }.block.call(self, @target) end |