Class: Net::IRC::Message

Inherits:
Object show all
Defined in:
lib/ircbot/core_ext/message.rb

Overview

core_ext

Direct Known Subclasses

Ircbot::Plugin::InitialMessage

Instance Method Summary collapse

Instance Method Details

#channelObject



5
6
7
# File 'lib/ircbot/core_ext/message.rb', line 5

def channel
  params[0]
end

#messageObject



9
10
11
# File 'lib/ircbot/core_ext/message.rb', line 9

def message
  params[1]
end

#reply(client, text) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/ircbot/core_ext/message.rb', line 13

def reply(client, text)
  to = (client.config.nick == params[0]) ? prefix.nick : params[0]
  unless text.to_s.empty?
    text = client.trim(text)
    client.privmsg to, text
  end
end