Class: Discorb::CommandInteraction::UserMenuCommand
- Inherits:
-
Discorb::CommandInteraction
- Object
- DiscordModel
- Interaction
- Discorb::CommandInteraction
- Discorb::CommandInteraction::UserMenuCommand
- Defined in:
- lib/discorb/interaction.rb
Overview
Represents a user context menu interaction.
Instance Attribute Summary collapse
-
#target -> Discorb::Member, Discorb::User
readonly
The target user.
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::Member, Discorb::User (readonly)
Returns The target user.
316 317 318 |
# File 'lib/discorb/interaction.rb', line 316 def target @target end |
Instance Method Details
#_set_data(data) -> Object
318 319 320 321 |
# File 'lib/discorb/interaction.rb', line 318 def _set_data(data) @target = guild.members[data[:target_id]] || Discorb::Member.new(@client, @guild_id, data[:resolved][:users][data[:target_id].to_sym], data[:resolved][:members][data[:target_id].to_sym]) @client.commands.find { |c| c.name == data[:name] && c.type_raw == 2 }.block.call(self, @target) end |