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
274
275
276
|
# File 'lib/discordrb/events/interactions.rb', line 274
def subcommands
@subcommands
end
|
Instance Method Details
286
287
288
289
290
291
292
293
294
|
# File 'lib/discordrb/events/interactions.rb', line 286
def group(name)
raise ArgumentError, 'Unable to mix subcommands and groups' if @subcommands.any? { |_, v| v.is_a? Proc }
builder = SubcommandBuilder.new(name)
yield builder
@subcommands.merge!(builder.to_h)
self
end
|
299
300
301
302
303
304
305
|
# File 'lib/discordrb/events/interactions.rb', line 299
def subcommand(name, &block)
raise ArgumentError, 'Unable to mix subcommands and groups' if @subcommands.any? { |_, v| v.is_a? Hash }
@subcommands[name.to_sym] = block
self
end
|