Class: Dazeus::Event::Command

Inherits:
Message show all
Defined in:
lib/dazeus/event/command.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#channel, #message, #network, #nick

Attributes inherited from Event

#dazeus, #event, #params

Instance Method Summary collapse

Methods inherited from Message

#action, #highlight, #reply

Methods inherited from Event

#initialize

Constructor Details

This class inherits a constructor from Dazeus::Event::Event

Instance Attribute Details

#argsObject

Returns the value of attribute args.



6
7
8
# File 'lib/dazeus/event/command.rb', line 6

def args
  @args
end

#commandObject

Returns the value of attribute command.



6
7
8
# File 'lib/dazeus/event/command.rb', line 6

def command
  @command
end

#remainderObject

Returns the value of attribute remainder.



6
7
8
# File 'lib/dazeus/event/command.rb', line 6

def remainder
  @remainder
end

Instance Method Details

#post_initObject



7
8
9
10
11
12
13
14
# File 'lib/dazeus/event/command.rb', line 7

def post_init
  super
  @remainder = if @params.length > 4 then @params[4] else '' end
  @message = @dazeus.highlightCharacter + @message
  @message += ' ' + @remainder if @remainder.length > 0
  @args = @params[5..-1]
  @args = [] if @args == nil
end