1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-11-05 09:40:20 +01:00
irc/doc/luairc/modules/callbacks.html
2012-12-01 01:06:15 -02:00

859 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../luadoc.css" type="text/css" />
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<div id="navigation">
<h1>LuaDoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<!-- Module list -->
<h1>Modules</h1>
<ul>
<li><strong>callbacks</strong></li>
<li>
<a href="../modules/irc.html">irc</a>
</li>
<li>
<a href="../modules/irc.channel.html">irc.channel</a>
</li>
<li>
<a href="../modules/irc.constants.html">irc.constants</a>
</li>
<li>
<a href="../modules/irc.ctcp.html">irc.ctcp</a>
</li>
<li>
<a href="../modules/irc.dcc.html">irc.dcc</a>
</li>
<li>
<a href="../modules/irc.debug.html">irc.debug</a>
</li>
<li>
<a href="../modules/irc.message.html">irc.message</a>
</li>
<li>
<a href="../modules/irc.misc.html">irc.misc</a>
</li>
</ul>
<!-- File list -->
</div><!-- id="navigation" -->
<div id="content">
<h1>Module <code>callbacks</code></h1>
<p>These are the callbacks that are available to register.</p>
<h2>Functions</h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#channel_act">channel_act</a>&nbsp;(channel, from, message)</td>
<td class="summary">This callback is triggered whenever a user performs a CTCP ACTION in a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#channel_msg">channel_msg</a>&nbsp;(channel, from, message)</td>
<td class="summary">This callback is triggered whenever a user sends a message to a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#channel_notice">channel_notice</a>&nbsp;(channel, from, message)</td>
<td class="summary">This callback is triggered whenever a user sends a notice to a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#connect">connect</a>&nbsp;()</td>
<td class="summary">This callback is triggered when the connection has completed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ctcp_error">ctcp_error</a>&nbsp;(from, to, message)</td>
<td class="summary">This callback is triggered when a CTCP command resulted in an error (for example, if the remote client doesn't implement that CTCP command).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dcc_send">dcc_send</a>&nbsp;(from, to, filename, address, port, filesize)</td>
<td class="summary">This callback is triggered when a user offers to send you a file using DCC SEND.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#deop">deop</a>&nbsp;(channel, from, to)</td>
<td class="summary">This callback is triggered whenever somebody loses ops.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#devoice">devoice</a>&nbsp;(channel, from, to)</td>
<td class="summary">This callback is triggered whenever somebody loses voice.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#invite">invite</a>&nbsp;(from, channel)</td>
<td class="summary">This callback is triggered whenever an invite to a channel is received.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#join">join</a>&nbsp;(channel, from)</td>
<td class="summary">This callback is triggered when a user joins a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#kick">kick</a>&nbsp;(channel, to, from)</td>
<td class="summary">This callback is triggered when a user is kicked from a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#me_join">me_join</a>&nbsp;(channel)</td>
<td class="summary">This callback is triggered after a join() command completes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nick_change">nick_change</a>&nbsp;(from, old_nick)</td>
<td class="summary">This callback is triggered when a user changes their nick.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#op">op</a>&nbsp;(channel, from, to)</td>
<td class="summary">This callback is triggered when a user is opped.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#part">part</a>&nbsp;(channel, from, message)</td>
<td class="summary">This callback is triggered when a user leaves a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#private_act">private_act</a>&nbsp;(from, message)</td>
<td class="summary">This callback is triggered when a user sends a CTCP ACTION in a private message.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#private_msg">private_msg</a>&nbsp;(from, message)</td>
<td class="summary">This callback is triggered when a user sends a private message.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#private_notice">private_notice</a>&nbsp;(from, message)</td>
<td class="summary">This callback is triggered when a user sends a private notice.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#quit">quit</a>&nbsp;(from, message)</td>
<td class="summary">This callback is triggered when a user quits.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#topic_change">topic_change</a>&nbsp;(channel)</td>
<td class="summary">This callback is triggered when a user changes the topic in a channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#voice">voice</a>&nbsp;(channel, from, to)</td>
<td class="summary">This callback is triggered when a user is voiced.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="functions"></a>Functions</h2>
<dl class="function">
<dt><a name="channel_act"></a><strong>channel_act</strong>&nbsp;(channel, from, message)</dt>
<dd>
This callback is triggered whenever a user performs a CTCP ACTION in a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the action was performed
</li>
<li>
from: User who performed the action
</li>
<li>
message: The action which was performed
</li>
</ul>
</dd>
<dt><a name="channel_msg"></a><strong>channel_msg</strong>&nbsp;(channel, from, message)</dt>
<dd>
This callback is triggered whenever a user sends a message to a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the message was sent
</li>
<li>
from: User who sent the message
</li>
<li>
message: The message which was sent
</li>
</ul>
</dd>
<dt><a name="channel_notice"></a><strong>channel_notice</strong>&nbsp;(channel, from, message)</dt>
<dd>
This callback is triggered whenever a user sends a notice to a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the notice was sent
</li>
<li>
from: User who sent the message
</li>
<li>
message: The notice which was sent
</li>
</ul>
</dd>
<dt><a name="connect"></a><strong>connect</strong>&nbsp;()</dt>
<dd>
This callback is triggered when the connection has completed.
</dd>
<dt><a name="ctcp_error"></a><strong>ctcp_error</strong>&nbsp;(from, to, message)</dt>
<dd>
This callback is triggered when a CTCP command resulted in an error (for example, if the remote client doesn't implement that CTCP command).
<h3>Parameters</h3>
<ul>
<li>
from: User who sent the error response
</li>
<li>
to: Who the response was sent to (either you or a channel you are in)
</li>
<li>
message: A description of the error
</li>
</ul>
</dd>
<dt><a name="dcc_send"></a><strong>dcc_send</strong>&nbsp;(from, to, filename, address, port, filesize)</dt>
<dd>
This callback is triggered when a user offers to send you a file using DCC SEND. It allows you to determine whether or not you want to accept the file.
<h3>Parameters</h3>
<ul>
<li>
from: User offering the file
</li>
<li>
to: User who is being offered the file (likely yourself)
</li>
<li>
filename: Name of the file being offered
</li>
<li>
address: IP address of the user offering the file
</li>
<li>
port: Port to connect to at that address
</li>
<li>
filesize: Size of the file being offered
</li>
</ul>
<h3>Return value:</h3>
True to accept the file, false to reject it
</dd>
<dt><a name="deop"></a><strong>deop</strong>&nbsp;(channel, from, to)</dt>
<dd>
This callback is triggered whenever somebody loses ops.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the user lost ops
</li>
<li>
from: User who removed the ops
</li>
<li>
to: User who lost ops
</li>
</ul>
</dd>
<dt><a name="devoice"></a><strong>devoice</strong>&nbsp;(channel, from, to)</dt>
<dd>
This callback is triggered whenever somebody loses voice.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the user lost voice
</li>
<li>
from: User who removed the voice
</li>
<li>
to: User who lost voice
</li>
</ul>
</dd>
<dt><a name="invite"></a><strong>invite</strong>&nbsp;(from, channel)</dt>
<dd>
This callback is triggered whenever an invite to a channel is received.
<h3>Parameters</h3>
<ul>
<li>
from: User who sent the invite
</li>
<li>
channel: Channel name that the invite was to
</li>
</ul>
</dd>
<dt><a name="join"></a><strong>join</strong>&nbsp;(channel, from)</dt>
<dd>
This callback is triggered when a user joins a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where there was a join
</li>
<li>
from: User who joined
</li>
</ul>
</dd>
<dt><a name="kick"></a><strong>kick</strong>&nbsp;(channel, to, from)</dt>
<dd>
This callback is triggered when a user is kicked from a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where there was a kick
</li>
<li>
to: User who was kicked
</li>
<li>
from: User who did the kicking
</li>
</ul>
</dd>
<dt><a name="me_join"></a><strong>me_join</strong>&nbsp;(channel)</dt>
<dd>
This callback is triggered after a join() command completes.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for the joined channel
</li>
</ul>
</dd>
<dt><a name="nick_change"></a><strong>nick_change</strong>&nbsp;(from, old_nick)</dt>
<dd>
This callback is triggered when a user changes their nick.
<h3>Parameters</h3>
<ul>
<li>
from: User who changed their nick
</li>
<li>
old_nick: The previous nick of that user
</li>
</ul>
</dd>
<dt><a name="op"></a><strong>op</strong>&nbsp;(channel, from, to)</dt>
<dd>
This callback is triggered when a user is opped.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the user was opped
</li>
<li>
from: User who gave the ops
</li>
<li>
to: User who was opped
</li>
</ul>
</dd>
<dt><a name="part"></a><strong>part</strong>&nbsp;(channel, from, message)</dt>
<dd>
This callback is triggered when a user leaves a channel.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the part occurred
</li>
<li>
from: User who left
</li>
<li>
message: Part message from the user
</li>
</ul>
</dd>
<dt><a name="private_act"></a><strong>private_act</strong>&nbsp;(from, message)</dt>
<dd>
This callback is triggered when a user sends a CTCP ACTION in a private message.
<h3>Parameters</h3>
<ul>
<li>
from: User who sent the action
</li>
<li>
message: The action that was sent
</li>
</ul>
</dd>
<dt><a name="private_msg"></a><strong>private_msg</strong>&nbsp;(from, message)</dt>
<dd>
This callback is triggered when a user sends a private message.
<h3>Parameters</h3>
<ul>
<li>
from: User who sent the message
</li>
<li>
message: The message that was sent
</li>
</ul>
</dd>
<dt><a name="private_notice"></a><strong>private_notice</strong>&nbsp;(from, message)</dt>
<dd>
This callback is triggered when a user sends a private notice.
<h3>Parameters</h3>
<ul>
<li>
from: User who sent the notice
</li>
<li>
message: The notice that was sent
</li>
</ul>
</dd>
<dt><a name="quit"></a><strong>quit</strong>&nbsp;(from, message)</dt>
<dd>
This callback is triggered when a user quits.
<h3>Parameters</h3>
<ul>
<li>
from: User who quit
</li>
<li>
message: The user's quit message
</li>
</ul>
</dd>
<dt><a name="topic_change"></a><strong>topic_change</strong>&nbsp;(channel)</dt>
<dd>
This callback is triggered when a user changes the topic in a channel. The contents of the topic can be seen in the <i>topic</i> field of the channel object.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the topic was changed.
</li>
</ul>
</dd>
<dt><a name="voice"></a><strong>voice</strong>&nbsp;(channel, from, to)</dt>
<dd>
This callback is triggered when a user is voiced.
<h3>Parameters</h3>
<ul>
<li>
channel: Channel object for where the user was voiced
</li>
<li>
from: User who gave the voice
</li>
<li>
to: User who was voiced
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>