Class: Discordrb::ApplicationCommand
- Inherits:
-
Object
- Object
- Discordrb::ApplicationCommand
- Defined in:
- lib/discordrb/data/interaction.rb
Overview
An ApplicationCommand for slash commands.
Constant Summary collapse
- TYPES =
Command types.
chat_input
is a command that appears in the text input field.user
andmessage
types appear as context menus for the respective resource. { chat_input: 1, user: 2, message: 3 }.freeze
Instance Attribute Summary collapse
- #application_id ⇒ Integer readonly
- #default_permission ⇒ true, false readonly
- #description ⇒ String readonly
- #id ⇒ Integer readonly
- #name ⇒ String readonly
- #options ⇒ Hash readonly
- #server_id ⇒ Integer? readonly
Instance Method Summary collapse
-
#delete ⇒ Object
Delete this application command.
- #edit(name: nil, description: nil, default_permission: nil) {|, | ... } ⇒ Object
Instance Attribute Details
#application_id ⇒ Integer (readonly)
283 284 285 |
# File 'lib/discordrb/data/interaction.rb', line 283 def application_id @application_id end |
#default_permission ⇒ true, false (readonly)
295 296 297 |
# File 'lib/discordrb/data/interaction.rb', line 295 def @default_permission end |
#description ⇒ String (readonly)
292 293 294 |
# File 'lib/discordrb/data/interaction.rb', line 292 def description @description end |
#id ⇒ Integer (readonly)
301 302 303 |
# File 'lib/discordrb/data/interaction.rb', line 301 def id @id end |
#name ⇒ String (readonly)
289 290 291 |
# File 'lib/discordrb/data/interaction.rb', line 289 def name @name end |
#options ⇒ Hash (readonly)
298 299 300 |
# File 'lib/discordrb/data/interaction.rb', line 298 def @options end |
#server_id ⇒ Integer? (readonly)
286 287 288 |
# File 'lib/discordrb/data/interaction.rb', line 286 def server_id @server_id end |
Instance Method Details
#delete ⇒ Object
Delete this application command.
327 328 329 |
# File 'lib/discordrb/data/interaction.rb', line 327 def delete @bot.delete_application_command(@id, server_id: @server_id) end |
#edit(name: nil, description: nil, default_permission: nil) {|, | ... } ⇒ Object
321 322 323 |
# File 'lib/discordrb/data/interaction.rb', line 321 def edit(name: nil, description: nil, default_permission: nil, &block) @bot.edit_application_command(@id, server_id: @server_id, name: name, description: description, default_permission: , &block) end |