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
244
245
246
|
# File 'lib/discordrb/events/interactions.rb', line 244
def subcommands
@subcommands
end
|
Instance Method Details
256
257
258
259
260
261
262
263
264
|
# File 'lib/discordrb/events/interactions.rb', line 256
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
|
269
270
271
272
273
274
275
|
# File 'lib/discordrb/events/interactions.rb', line 269
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
|