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
247
248
249
|
# File 'lib/discordrb/events/interactions.rb', line 247
def subcommands
@subcommands
end
|
Instance Method Details
259
260
261
262
263
264
265
266
267
|
# File 'lib/discordrb/events/interactions.rb', line 259
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
|
272
273
274
275
276
277
278
|
# File 'lib/discordrb/events/interactions.rb', line 272
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
|