Tutorial on plugins

Cheatsheet: OnHandlers

OnHandlers installs a method_added method and...
The first argument is always the Listener object that was subscribed.

on_join(listener, user, channel)

Is triggered whenever a user joins a channel, that includes butler.

user
A Butler::IRC::User, the user that joined.
channel
An Butler::IRC::Channel, the channel the user joined.
on_privmsg(listener, from, text, realm)

Is triggered whenever a user sends a privmsg to a channel butler is in or directly to butler.

from
A Butler::IRC::User, the user that joined.
text
A String with the text of the message.
realm
A Symbol with the realm of the message.
on_notice(listener, from, text, realm)

Is triggered whenever a user sends a notice to a channel butler is in or directly to butler.

from
A Butler::IRC::User, the user that joined.
text
A String with the text of the message.
realm
A Symbol with the realm of the message.
on_nick(listener, from, old_nick)

Is triggered when a user changes his nick.

from
A Butler::IRC::User, the user that changed the nick (User#nick will give the new nick).
old_nick
A String with the old nick of the user.
on_topic(listener, from, channel, text)

Is triggered when a topic of a channel butler is in is changed.

from
A Butler::IRC::User, the user that changed the topic.
channel
A Butler::IRC::Channel, the channel in which the topic was changed.
text
The new topic
on_part(listener, user, channel, reason)

Is triggered when a user parts a channel butler is in (that includes butler).

user
A Butler::IRC::User, the user that parted.
channel
A Butler::IRC::Channel, the channel from which he parted.
reason
The reason the user provided, why he left the channel.
on_quit(listener, user, from, reason)

Is triggered when a user quits while being in a channel butler is in (that includes butler).

user
A Butler::IRC::User, the user that quit.
reason
The reason the user provided, why he quit.
on_kick(listener, kicker, kicked, channel, reason)

Is triggered when a user is kicked from a channel butler is in (that includes butler).

kicker
A Butler::IRC::User, the user that kicked.
kicked
A Butler::IRC::User, the user that was kicked.
channel
A Butler::IRC::Channel, the channel the user was kicked from.
reason
The reason the kicker provided, why the other was kicked.
on_kill(listener, killer, killed, reason)

Is triggered when a user that shares a channel with butler is killed (that includes butler).

killer
A Butler::IRC::User, the user that killed.
killed
A Butler::IRC::User, the user that was killed.
reason
The reason the kicker provided, why the other was killed.
on_invocation(listener)

Is triggered when a user invokes butler (writes a message directly to butler or sends a privmsg or notice starting with butlers nick to a channel butler is in).

on_ban(listener, *banned)

Is triggered when one or multiple users are banned from a channel butler is in.

banned
The hostmasks that are added to the banlist.
on_unban(listener, *unbanned)

Is triggered when one or multiple masks are removed from the banlist of a channel butler is in.

unbanned
The hostmasks that are removed to the banlist.
on_op(listener, *oped)

Is triggered when one or multiple users gain op in a channel butler is in.

oped
The nicks of the users that were oped.
on_deop(listener, *deoped)

Is triggered when one or multiple users get their op status revoked in a channel butler is in.

deoped
The nicks of the users that were deoped.
on_voice(listener, *voiced)

Is triggered when one or multiple users gain voice in a channel butler is in.

voiced
The nicks of the users that were voiced.
on_devoice(listener, *devoiced)

Is triggered when one or multiple users get their voice status revoked in a channel butler is in.

devoiced
The nicks of the users that were devoiced.

Valid XHTML, 2007-02-12 00:04 CET