Mercurial > irccd
comparison man/irccd.1 @ 895:f0d6bc79aa32
irccd: implement hooks, closes #2342 @2h
The hook mechanism is an alternative approach to plugins which allow the user to
write lightweight scripts in any language.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 05 Sep 2019 13:39:32 +0200 |
parents | 0028704ab284 |
children | 5e25439fe98d |
comparison
equal
deleted
inserted
replaced
891:6704e7ded799 | 895:f0d6bc79aa32 |
---|---|
59 .El | 59 .El |
60 .\" PLUGINS | 60 .\" PLUGINS |
61 .Sh PLUGINS | 61 .Sh PLUGINS |
62 The | 62 The |
63 .Nm | 63 .Nm |
64 program can runs plugins once IRC events are received. For example, if someone | 64 program can run plugins once IRC events are received. For example, if someone |
65 sends you a private message plugins will be invoked with that event. Both native | 65 sends you a private message plugins will be invoked with that event. Both native |
66 plugins written in C++ and Javascript are supported (if enabled at compile | 66 plugins written in C++ and Javascript are supported (if enabled at compile |
67 time). | 67 time). |
68 .Pp | 68 .Pp |
69 The following IRC events are supported: | 69 The following IRC events are supported: |
171 .El | 171 .El |
172 .Pp | 172 .Pp |
173 See additional documentation in their own manual page in the form | 173 See additional documentation in their own manual page in the form |
174 .Xr irccd-plugin-name 7 | 174 .Xr irccd-plugin-name 7 |
175 where name is the actual plugin name. | 175 where name is the actual plugin name. |
176 .\" HOOKS | |
177 .Sh HOOKS | |
178 Hooks are a different and more lightweight approach to plugins, they are | |
179 executed upon incoming events and spawned each time a new event arrives. | |
180 .Pp | |
181 In contrast to plugins, differences are: | |
182 .Pp | |
183 .Bl -bullet -compact | |
184 .It | |
185 Hooks can not be filtered with rules. | |
186 .It | |
187 Hooks does not support all events. These events are not supported: | |
188 .Em onLoad , onUnload , onReload , onCommand , onNames , onWhois . | |
189 .It | |
190 Hooks can be written in any language. | |
191 .It | |
192 Execution may be slower since scripting languages require to fire up the | |
193 interpreter each time a new event is available. | |
194 .El | |
195 .Pp | |
196 Each hook will receive as positional argument the event name (similar to plugin | |
197 events) and the event arguments. | |
198 .Pp | |
199 An example of hook in shell script is available as | |
200 .Pa @CMAKE_INSTALL_FULL_DOCDIR@/examples/sample-hook.sh | |
201 file. | |
202 .Pp | |
203 See also the section | |
204 .Va [hooks] | |
205 in | |
206 .Xr irccd.conf 5 | |
207 manual page to enable hooks. | |
176 .\" TRANSPORTS | 208 .\" TRANSPORTS |
177 .Sh TRANSPORTS | 209 .Sh TRANSPORTS |
178 The daemon can be controlled at runtime using the dedicated | 210 The daemon can be controlled at runtime using the dedicated |
179 .Nm irccdctl | 211 .Nm irccdctl |
180 tool or using sockets. | 212 tool or using sockets. |