Module Net::IRCOutputAPI
In: lib/net/yail/output_api.rb

All output APIs live here. In most cases, an outgoing handler will get a call, but will not be able to stop the socket output since that‘s sorta an essential part of this whole library.

Argument Duping

Output APIs dup incoming args before sending them off to handlers. This is a mechanism that I think could be done better, but I can‘t figure a good way to do it at the moment. The reason this is necessary is for a specific situation where a bot has an array of response messages, and needs to filter those messages. A call to "msg(messages[rand(10)])" with a handler on :outgoing_msg that does something like text.gsub!(‘a’, ’@’) (like a leetspeek filter) shouldn‘t destroy the original data in the messages array.

This could be left up to the programmer, but it seems like something that a library should own - protecting the programmer for having to remember that sort of crap, especially if the app is calling msg, act, ctcp, etc. in various ways from multiple points in the code.…

Apologies, good sirs

If a method exists in this module, and it isn‘t the raw method, chances are it‘s got a handler in the form of :outgoing_<method name>. I am hoping I document all of those in the main Net::YAIL code, but if I miss one, I apologize.

Methods

act   ctcp   ctcpreply   invite   join   kick   list   mode   msg   names   nick   notice   oper   part   pass   privmsg   quit   raw   topic   user  

Public Instance methods

Calls :outgoing_act handler, then ctcp to send a CTCP ACTION (text) to a given user or channel (target)

Calls :outgoing_ctcp handler, then sends CTCP to target channel or user

Calls :outgoing_ctcpreply handler, then uses notice method to send the CTCP text

Invites a user to a channel. Calls :outgoing_invite and raw INVITE command.

Calls :outgoing_join handler and then raw JOIN message for a given channel

Kicks the given user from the channel with the optional comment. Calls :outgoing_kick and issues a raw KICK command.

I don‘t know what the server param is for, but it‘s in the RFC. If channel is blank, lists all visible, otherwise just lists the channel in question. Calls :outgoing_list and raw LIST command.

Calls :outgoing_mode handler, then mode to set mode(s) on a channel and possibly specific users (objects). If modes and objects are blank, just sends a raw MODE query.

Calls :outgoing_msg handler, then privmsg to send the message out. Could be used to send any privmsg, but you‘re betting off using act and ctcp shortcut methods for those types. Target is a channel or username, text is the message.

Gets a list of users and channels if channel isn‘t specified. If channel is specified, only shows users in that channel. Will not show invisible users or channels. Calls :outgoing_names and raw NAMES command.

Calls :outgoing_nick handler and then sends raw NICK message to change nickname.

Calls :outgoing_notice handler, then outputs raw NOTICE message

Sends an op request. Calls :outgoing_oper and raw OPER command.

Calls :outgoing_part handler and then raw PART for leaving a given channel (with an optional message)

Sends a password to the server. This must be sent before NICK/USER. Calls :outgoing_pass and sends raw PASS command.

Calls :outgoing_privmsg handler, then sends a message (text) out to the given channel/user (target), and reports itself with the given string. This method shouldn‘t be called directly most of the time - just use msg, act, ctcp, etc.

This is sort of the central message output - everything that‘s based on PRIVMSG (messages, actions, other ctcp) uses this. Because these messages aren‘t insanely important, we actually buffer them instead of sending straight out to the channel. The output thread has to deal with sending these out.

Calls :outgoing_quit handler and then raw QUIT message with an optional reason

Spits a raw string out to the server - in case a subclass wants to do something special on all output, please make all output go through this method. Don‘t use puts manually. I will kill violaters. Legally speaking, that is.

Gets or sets the topic. Calls :outgoing_topic and raw TOPIC command

Identifies ourselves to the server. Calls :outgoing_user and sends raw USER command.

[Validate]