]> git.lizzy.rs Git - luairc.git/blob - src/callbacks.luadoc
Port to Lua 5.3
[luairc.git] / src / callbacks.luadoc
1 ---
2 -- These are the callbacks that are available to register.
3 module "callbacks"
4
5 ---
6 -- This callback is triggered whenever a user performs a CTCP ACTION in a
7 -- channel.
8 -- @param channel Channel object for where the action was performed
9 -- @param from    User who performed the action
10 -- @param message The action which was performed
11 function channel_act(channel, from, message)
12 end
13
14 ---
15 -- This callback is triggered whenever a user sends a message to a channel.
16 -- @param channel Channel object for where the message was sent
17 -- @param from    User who sent the message
18 -- @param message The message which was sent
19 function channel_msg(channel, from, message)
20 end
21
22 ---
23 -- This callback is triggered whenever a user sends a notice to a channel.
24 -- @param channel Channel object for where the notice was sent
25 -- @param from    User who sent the message
26 -- @param message The notice which was sent
27 function channel_notice(channel, from, message)
28 end
29
30 ---
31 -- This callback is triggered when the connection has completed.
32 function connect()
33 end
34
35 ---
36 -- This callback is triggered when a CTCP command resulted in an error (for
37 -- example, if the remote client doesn't implement that CTCP command).
38 -- @param from    User who sent the error response
39 -- @param to      Who the response was sent to (either you or a channel you are
40 --                in)
41 -- @param message A description of the error
42 function ctcp_error(from, to, message)
43 end
44
45 ---
46 -- This callback is triggered when a user offers to send you a file using DCC
47 -- SEND. It allows you to determine whether or not you want to accept the file.
48 -- @param from     User offering the file
49 -- @param to       User who is being offered the file (likely yourself)
50 -- @param filename Name of the file being offered
51 -- @param address  IP address of the user offering the file
52 -- @param port     Port to connect to at that address
53 -- @param filesize Size of the file being offered
54 -- @return True to accept the file, false to reject it
55 function dcc_send(from, to, filename, address, port, filesize)
56 end
57
58 ---
59 -- This callback is triggered whenever somebody loses ops.
60 -- @param channel Channel object for where the user lost ops
61 -- @param from    User who removed the ops
62 -- @param to      User who lost ops
63 function deop(channel, from, to)
64 end
65
66 ---
67 -- This callback is triggered whenever somebody loses voice.
68 -- @param channel Channel object for where the user lost voice
69 -- @param from    User who removed the voice
70 -- @param to      User who lost voice
71 function devoice(channel, from, to)
72 end
73
74 ---
75 -- This callback is triggered whenever an invite to a channel is received.
76 -- @param from    User who sent the invite
77 -- @param channel Channel name that the invite was to
78 function invite(from, channel)
79 end
80
81 ---
82 -- This callback is triggered when a user joins a channel.
83 -- @param channel Channel object for where there was a join
84 -- @param from    User who joined
85 function join(channel, from)
86 end
87
88 ---
89 -- This callback is triggered when a user is kicked from a channel.
90 -- @param channel Channel object for where there was a kick
91 -- @param to      User who was kicked
92 -- @param from    User who did the kicking
93 function kick(channel, to, from)
94 end
95
96 ---
97 -- This callback is triggered after a join() command completes.
98 -- @param channel Channel object for the joined channel
99 function me_join(channel)
100 end
101
102 ---
103 -- This callback is triggered when a user changes their nick.
104 -- @param from     User who changed their nick
105 -- @param old_nick The previous nick of that user
106 function nick_change(from, old_nick)
107 end
108
109 ---
110 -- This callback is triggered when a user is opped.
111 -- @param channel Channel object for where the user was opped
112 -- @param from    User who gave the ops
113 -- @param to      User who was opped
114 function op(channel, from, to)
115 end
116
117 ---
118 -- This callback is triggered when a user leaves a channel.
119 -- @param channel Channel object for where the part occurred
120 -- @param from    User who left
121 -- @param message Part message from the user
122 function part(channel, from, message)
123 end
124
125 ---
126 -- This callback is triggered when a user sends a CTCP ACTION in a private
127 -- message.
128 -- @param from    User who sent the action
129 -- @param message The action that was sent
130 function private_act(from, message)
131 end
132
133 ---
134 -- This callback is triggered when a user sends a private message.
135 -- @param from    User who sent the message
136 -- @param message The message that was sent
137 function private_msg(from, message)
138 end
139
140 ---
141 -- This callback is triggered when a user sends a private notice.
142 -- @param from    User who sent the notice
143 -- @param message The notice that was sent
144 function private_notice(from, message)
145 end
146
147 ---
148 -- This callback is triggered when a user quits.
149 -- @param from    User who quit
150 -- @param message The user's quit message
151 function quit(from, message)
152 end
153
154 ---
155 -- This callback is triggered when a user changes the topic in a channel. The
156 -- contents of the topic can be seen in the <i>topic</i> field of the channel
157 -- object.
158 -- @param channel Channel object for where the topic was changed.
159 function topic_change(channel)
160 end
161
162 ---
163 -- This callback is triggered when a user is voiced.
164 -- @param channel Channel object for where the user was voiced
165 -- @param from    User who gave the voice
166 -- @param to      User who was voiced
167 function voice(channel, from, to)
168 end