Class | Irc::UserMessage
In: | lib/rbot/message.rb
Parent: | BasicUserMessage

class for handling IRC user messages. Includes some utilities for handling the message, for example in plugins. The `message` member will have any bot addressing "^bot: " removed (address? will return true in this case)

### Methods

act action? ctcp_reply inspect new nickokay nickreply notify okay plainokay plainreply private? public? reply

### Attributes

action | [R] | for PRIVMSGs, true if the message was a CTCP ACTION (CTCP stuff will be stripped from the message)
channel | [R] | channel the message was in, nil for privately addressed messages
ctcp | [R] | for PRIVMSGs, false unless the message was a CTCP command, in which case it evaluates to the CTCP command itself (TIME, PING, VERSION, etc). The CTCP command parameters are then stored in the message.
params | [R] | for plugin messages, the rest of the message, with the plugin name removed
plugin | [R] | for plugin messages, the name of the plugin invoked by the message
replyto | [R] | convenience member. Who to reply to (i.e. would be sourcenick for a privately addressed message, or target (the channel) for a publicly addressed message

### Public Class methods

new(bot, server, source, target, message)

instantiate a new UserMessage

bot: | associated bot class
source: | hostmask of the message source
target: | nick/channel message is destined for
message: | message part

### Public Instance methods

act(string, options={})

convenience method to reply to a message with an action. It‘s the same as doing: `@bot.action m.replyto, string` So if the message is private, it will reply to the user. If it was in a channel, it will reply in the channel.

action?()
ctcp_reply(string, options={})

send a CTCP response, i.e. a private NOTICE to the sender with the same CTCP command and the reply as a parameter

inspect()
nickokay()

Like the above, but append the username

nickreply(string, options={})

Same as reply, but when replying in public it adds the nick of the user the bot is replying to

notify(msg,opts={})

send a NOTICE to the message source

okay()

the default okay style is the same as the default reply style

plainokay()

convenience method to reply "okay" in the current language to the message

plainreply(string, options={})

convenience method to reply to a message, useful in plugins. It‘s the same as doing: `@bot.say m.replyto, string` So if the message is private, it will reply to the user. If it was in a channel, it will reply in the channel.

private?()

returns true for private messages, e.g. "/msg bot hello"

public?()

returns true if the message was in a channel

reply(string, options={})

the default reply style is to nickreply unless the reply already contains the nick or core.reply_with_nick is set to false

[Validate]