Class: Discordrb::Events::ApplicationCommandEventHandler
Overview
Event handler for ApplicationCommandEvents.
Instance Attribute Summary collapse
Instance Method Summary
collapse
#after_call, #match, #matches_all
Instance Attribute Details
#subcommands ⇒ Hash
283
284
285
|
# File 'lib/discordrb/events/interactions.rb', line 283
def subcommands
@subcommands
end
|
Instance Method Details
295
296
297
298
299
300
301
302
303
|
# File 'lib/discordrb/events/interactions.rb', line 295
def group(name)
raise ArgumentError, 'Unable to mix subcommands and groups' if @subcommands.any? { |n, v| n == name && v.is_a?(Proc) }
builder = SubcommandBuilder.new(name)
yield builder
@subcommands.merge!(builder.to_h)
self
end
|
308
309
310
311
312
313
314
|
# File 'lib/discordrb/events/interactions.rb', line 308
def subcommand(name, &block)
raise ArgumentError, 'Unable to mix subcommands and groups' if @subcommands.any? { |n, v| n == name && v.is_a?(Hash) }
@subcommands[name.to_sym] = block
self
end
|