Class: Dazeus::Event::Message

Inherits:
Event
  • Object
show all
Defined in:
lib/dazeus/event/message.rb

Direct Known Subclasses

Action, Command

Instance Attribute Summary collapse

Attributes inherited from Event

#dazeus, #event, #params

Instance Method Summary collapse

Methods inherited from Event

#initialize

Constructor Details

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

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



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

def channel
  @channel
end

#messageObject

Returns the value of attribute message.



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

def message
  @message
end

#networkObject

Returns the value of attribute network.



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

def network
  @network
end

#nickObject

Returns the value of attribute nick.



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

def nick
  @nick
end

Instance Method Details

#action(message) ⇒ Object



24
25
26
# File 'lib/dazeus/event/message.rb', line 24

def action(message)
  reply(message, false, true)
end

#highlight(message) ⇒ Object



20
21
22
# File 'lib/dazeus/event/message.rb', line 20

def highlight(message)
  reply(message, true)
end

#post_initObject



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

def post_init
  super
  @network = @params[0]
  @nick = @params[1]
  @channel = @params[2]
  @message = @params[3]
end

#reply(message, highlight = false, action = false) ⇒ Object



16
17
18
# File 'lib/dazeus/event/message.rb', line 16

def reply(message, highlight=false, action=false)
  @dazeus.reply(@network, @channel, @nick, message, highlight, action)
end