aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.luadoc
blob: c57980ba367e892a5a819f3251aa5fad2952506b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
-- These are the callbacks that are available to register.
module "callbacks"

---
-- This callback is triggered whenever a user performs a CTCP ACTION in a
-- channel.
-- @param channel Channel object for where the action was performed
-- @param from    User who performed the action
-- @param message The action which was performed
function channel_act(channel, from, message)
end

---
-- This callback is triggered whenever a user sends a message to a channel.
-- @param channel Channel object for where the message was sent
-- @param from    User who sent the message
-- @param message The message which was sent
function channel_msg(channel, from, message)
end

---
-- This callback is triggered whenever a user sends a notice to a channel.
-- @param channel Channel object for where the notice was sent
-- @param from    User who sent the message
-- @param message The notice which was sent
function channel_notice(channel, from, message)
end

---
-- This callback is triggered when the connection has completed.
function connect()
end

---
-- This callback is triggered when a CTCP command resulted in an error (for
-- example, if the remote client doesn't implement that CTCP command).
-- @param from    User who sent the error response
-- @param to      Who the response was sent to (either you or a channel you are
--                in)
-- @param message A description of the error
function ctcp_error(from, to, message)
end

---
-- 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.
-- @param from     User offering the file
-- @param to       User who is being offered the file (likely yourself)
-- @param filename Name of the file being offered
-- @param address  IP address of the user offering the file
-- @param port     Port to connect to at that address
-- @param filesize Size of the file being offered
-- @return True to accept the file, false to reject it
function dcc_send(from, to, filename, address, port, filesize)
end

---
-- This callback is triggered whenever somebody loses ops.
-- @param channel Channel object for where the user lost ops
-- @param from    User who removed the ops
-- @param to      User who lost ops
function deop(channel, from, to)
end

---
-- This callback is triggered whenever somebody loses voice.
-- @param channel Channel object for where the user lost voice
-- @param from    User who removed the voice
-- @param to      User who lost voice
function devoice(channel, from, to)
end

---
-- This callback is triggered whenever an invite to a channel is received.
-- @param from    User who sent the invite
-- @param channel Channel name that the invite was to
function invite(from, channel)
end

---
-- This callback is triggered when a user joins a channel.
-- @param channel Channel object for where there was a join
-- @param from    User who joined
function join(channel, from)
end

---
-- This callback is triggered when a user is kicked from a channel.
-- @param channel Channel object for where there was a kick
-- @param to      User who was kicked
-- @param from    User who did the kicking
function kick(channel, to, from)
end

---
-- This callback is triggered after a join() command completes.
-- @param channel Channel object for the joined channel
function me_join(channel)
end

---
-- This callback is triggered when a user changes their nick.
-- @param from     User who changed their nick
-- @param old_nick The previous nick of that user
function nick_change(from, old_nick)
end

---
-- This callback is triggered when a user is opped.
-- @param channel Channel object for where the user was opped
-- @param from    User who gave the ops
-- @param to      User who was opped
function op(channel, from, to)
end

---
-- This callback is triggered when a user leaves a channel.
-- @param channel Channel object for where the part occurred
-- @param from    User who left
-- @param message Part message from the user
function part(channel, from, message)
end

---
-- This callback is triggered when a user sends a CTCP ACTION in a private
-- message.
-- @param from    User who sent the action
-- @param message The action that was sent
function private_act(from, message)
end

---
-- This callback is triggered when a user sends a private message.
-- @param from    User who sent the message
-- @param message The message that was sent
function private_msg(from, message)
end

---
-- This callback is triggered when a user sends a private notice.
-- @param from    User who sent the notice
-- @param message The notice that was sent
function private_notice(from, message)
end

---
-- This callback is triggered when a user quits.
-- @param from    User who quit
-- @param message The user's quit message
function quit(from, message)
end

---
-- 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.
-- @param channel Channel object for where the topic was changed.
function topic_change(channel)
end

---
-- This callback is triggered when a user is voiced.
-- @param channel Channel object for where the user was voiced
-- @param from    User who gave the voice
-- @param to      User who was voiced
function voice(channel, from, to)
end