@@ -130,7 +130,7 @@ def matches?(event)
130130 # Event for ApplicationCommand interactions.
131131 class ApplicationCommandEvent < InteractionCreateEvent
132132 # Struct to allow accessing data via [] or methods.
133- Resolved = Struct . new ( 'Resolved' , :channels , :members , :messages , :roles , :users ) # rubocop:disable Lint/StructNewOverride
133+ Resolved = Struct . new ( 'Resolved' , :channels , :members , :messages , :roles , :users , :attachments ) # rubocop:disable Lint/StructNewOverride
134134
135135 # @return [String] The name of the command.
136136 attr_reader :command_name
@@ -162,7 +162,7 @@ def initialize(data, bot)
162162 @command_name = command_data [ 'name' ] . to_sym
163163
164164 @target_id = command_data [ 'target_id' ] &.to_i
165- @resolved = Resolved . new ( { } , { } , { } , { } , { } )
165+ @resolved = Resolved . new ( { } , { } , { } , { } , { } , { } )
166166 process_resolved ( command_data [ 'resolved' ] ) if command_data [ 'resolved' ]
167167
168168 options = command_data [ 'options' ] || [ ]
@@ -219,6 +219,10 @@ def process_resolved(resolved_data)
219219 resolved_data [ 'messages' ] &.each do |id , data |
220220 @resolved [ :messages ] [ id . to_i ] = Discordrb ::Message . new ( data , @bot )
221221 end
222+
223+ resolved_data [ 'attachments' ] &.each do |id , data |
224+ @resolved [ :attachments ] [ id . to_i ] = Discordrb ::Attachment . new ( data , nil , @bot )
225+ end
222226 end
223227
224228 def transform_options_hash ( hash )
0 commit comments