Class: Discordrb::Commands::CommandEvent
- Inherits:
-
Events::MessageEvent
- Object
- Events::MessageEvent
- Discordrb::Commands::CommandEvent
- Defined in:
- lib/discordrb/commands/events.rb
Overview
Extension of MessageEvent for commands that contains the command called, makes the bot readable and adds a message to be saved
Instance Attribute Summary collapse
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
-
#command ⇒ Object
Returns the value of attribute command.
-
#saved_message ⇒ Object
readonly
Returns the value of attribute saved_message.
Attributes inherited from Events::MessageEvent
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize(message, bot) ⇒ CommandEvent
constructor
A new instance of CommandEvent.
Methods inherited from Events::MessageEvent
Constructor Details
#initialize(message, bot) ⇒ CommandEvent
Returns a new instance of CommandEvent.
9 10 11 12 |
# File 'lib/discordrb/commands/events.rb', line 9 def initialize(, bot) super(, bot) @saved_message = '' end |
Instance Attribute Details
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
6 7 8 |
# File 'lib/discordrb/commands/events.rb', line 6 def bot @bot end |
#command ⇒ Object
Returns the value of attribute command.
7 8 9 |
# File 'lib/discordrb/commands/events.rb', line 7 def command @command end |
#saved_message ⇒ Object (readonly)
Returns the value of attribute saved_message.
6 7 8 |
# File 'lib/discordrb/commands/events.rb', line 6 def @saved_message end |
Instance Method Details
#<<(message) ⇒ Object
14 15 16 17 |
# File 'lib/discordrb/commands/events.rb', line 14 def <<() @saved_message += "#{}\n" nil end |