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
236
237
238
|
# File 'lib/discordrb/events/interactions.rb', line 236
def subcommands
@subcommands
end
|
Instance Method Details
248
249
250
251
252
253
254
255
256
|
# File 'lib/discordrb/events/interactions.rb', line 248
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
|
261
262
263
264
265
266
267
|
# File 'lib/discordrb/events/interactions.rb', line 261
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
|