comparison man/irccd-api-server.3 @ 932:0e11221c9bcc

man: split irccd-api into individual ones
author David Demelier <markand@malikania.fr>
date Tue, 05 Jan 2021 22:25:47 +0100
parents
children 2a6d753f79f6
comparison
equal deleted inserted replaced
931:c78ad0799e68 932:0e11221c9bcc
1 .\"
2 .\" Copyright (c) 2013-2020 David Demelier <markand@malikania.fr>
3 .\"
4 .\" Permission to use, copy, modify, and/or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd @IRCCD_MAN_DATE@
17 .Dt IRCCD-API-SERVER 3
18 .Os
19 .\" NAME
20 .Sh NAME
21 .Nm Irccd.Unicode
22 .Nd server management
23 .\" SYNOPSIS
24 .Sh SYNOPSIS
25 .Fn Irccd.Server.add "server"
26 .Fn Irccd.Server.find "name"
27 .Fn Irccd.Server.list
28 .Fn Irccd.Server.remove "name"
29 .Fn Irccd.Server "parameters"
30 .Fn Irccd.Server.prototype.info
31 .Fn Irccd.Server.prototype.invite "target, channel"
32 .Fn Irccd.Server.prototype.isSelf "nickname"
33 .Fn Irccd.Server.prototype.join "channel, password = undefined"
34 .Fn Irccd.Server.prototype.kick "target, channel, reason = undefined"
35 .Fn Irccd.Server.prototype.me "target, message"
36 .Fn Irccd.Server.prototype.message "target, message"
37 .Fn Irccd.Server.prototype.mode "target, mode, limit, user, mode"
38 .Fn Irccd.Server.prototype.names "channel"
39 .Fn Irccd.Server.prototype.nick "nickname"
40 .Fn Irccd.Server.prototype.notice "target, message"
41 .Fn Irccd.Server.prototype.part "channel, reason = undefined"
42 .Fn Irccd.Server.prototype.toString
43 .Fn Irccd.Server.prototype.topic "target, topic"
44 .Fn Irccd.Server.prototype.whois "target"
45 .\" DESCRIPTION
46 .Sh DESCRIPTION
47 This module is the object that you received in almost all IRC event (e.g.
48 onConnect). You can use its methods to do your required actions on the server.
49 .\" METHODS
50 .Sh METHODS
51 .\" Irccd.Server.add
52 The
53 .Fn Irccd.Server.add
54 method adds the new
55 .Fa server
56 into the irccd instance.
57 .Pp
58 .\" Irccd.Server.find
59 The
60 .Fn Irccd.Server.find
61 method finds a server by its
62 .Fa name
63 and returns it.
64 .Pp
65 .\" Irccd.Server.list
66 The
67 .Fn Irccd.Server.list
68 method returns a map of all running servers. The table of all servers as
69 key-value pairs where key is the server identifier and value the object itself.
70 .Pp
71 .\" Irccd.Server.remove
72 The
73 .Fn Irccd.Server.remove
74 method removes the server specified by
75 .Fa name
76 from the irccd instance and disconnects it.
77 .Pp
78 .\" Irccd.Server
79 The
80 .Fn Irccd.Server
81 constructor function creates a new server with settings in the
82 .Fa parameters
83 object which may have the following properties:
84 .Pp
85 .Bl -tag -width 20n -compact -offset Ds
86 .It Fa name No (string)
87 The unique identifier name.
88 .It Fa hostname No (string)
89 The host or IP address.
90 .It Fa ipv4 No (bool)
91 Enable ipv4 (Optional, default: true).
92 .It Fa ipv6 No (bool)
93 Enable ipv6, (Optional, default: true).
94 .It Fa port No (int)
95 The port number, (Optional, default: 6667).
96 .It Fa password No (string)
97 The password, (Optional, default: undefined).
98 .It Fa channels No (array)
99 Array of channels (Optional, default: empty).
100 .It Fa ssl No (bool)
101 True to use ssl (Optional, default: false).
102 .It Fa nickname No (string)
103 Nickname, (Optional, default: irccd).
104 .It Fa username No (string)
105 User name, (Optional, default: irccd).
106 .It Fa realname No (string)
107 Real name, (Optional, default: IRC Client Daemon).
108 .It Fa commandChar No (string)
109 Plugin prefix character, (Optional, default: "!").
110 .El
111 .Pp
112 .\" Irccd.Server.prototype.info
113 The
114 .Fn Irccd.Server.prototype.info
115 method returns the server information. The object have the following
116 properties:
117 .Pp
118 .Bl -tag -width 20n -compact -offset Ds
119 .It Va name No (string)
120 The server unique name.
121 .It Va hostname No (string)
122 The host name.
123 .It Va port No (int)
124 The port number.
125 .It Va ssl No (bool)
126 True if using ssl.
127 .It Va channels No (array)
128 An array of all channels.
129 .It Va realname No (string)
130 The current real name.
131 .It Va username No (string)
132 The user name.
133 .It Va nickname No (string)
134 The current nickname.
135 .El
136 .Pp
137 .\" Irccd.Server.prototype.invite
138 The
139 .Fn Irccd.Server.prototype.invite
140 method invites the specified
141 .Fa target
142 on the given
143 .Fa channel .
144 .Pp
145 .\" Irccd.Server.prototype.isSelf
146 The
147 .Fn Irccd.Server.prototype.isSelf
148 method returns true if
149 .Fa nickname
150 targets the bot.
151 .Pp
152 .\" Irccd.Server.prototype.join
153 The
154 .Fn Irccd.Server.prototype.join
155 method joins the specified
156 .Fa channel
157 with an optional
158 .Fa password .
159 .Pp
160 .\" Irccd.Server.prototype.kick
161 The
162 .Fn Irccd.Server.prototype.kick
163 method kicks the specified
164 .Fa target
165 from the
166 .Fa channel ,
167 the
168 .Fa reason
169 is optional.
170 .Pp
171 .\" Irccd.Server.prototype.me
172 The
173 .Fn Irccd.Server.prototype.me
174 method sends an action emote
175 .Fa message
176 to the given
177 .Fa target .
178 .Pp
179 .\" Irccd.Server.prototype.message
180 The
181 .Fn Irccd.Server.prototype.message
182 method sends the
183 .Fa message
184 to the specified
185 .Fa target .
186 .Pp
187 .\" Irccd.Server.prototype.mode
188 The
189 .Fn Irccd.Server.prototype.mode
190 method changes irccd's user mode or a channel mode. If the
191 .Fa target
192 is the bot's nickname, it changes its
193 .Fa mode .
194 otherwise it changes the channel one.
195 The optional argument
196 .Fa limit , user
197 and
198 .Fa mask
199 are required depending on the mode mask. See IRC specification for more
200 details.
201 .Pp
202 .\" Irccd.Server.prototype.names
203 The
204 .Fn Irccd.Server.prototype.names
205 method requests a list of names for the given
206 .Fa channel .
207 This function will generate the onNames event.
208 .Pp
209 .\" Irccd.Server.prototype.nick
210 The
211 .Fn Irccd.Server.prototype.nick
212 method changes the bot's
213 .Fa nickname .
214 .Pp
215 .\" Irccd.Server.prototype.notice
216 The
217 .Fn Irccd.Server.prototype.notice
218 method sends a private notice
219 .Fa message
220 to the specified
221 .Fa target .
222 .Pp
223 .\" Irccd.Server.prototype.part
224 The
225 .Fn Irccd.Server.prototype.part
226 method leaves the specified
227 .Fa channel ,
228 using an optional
229 .Fa reason
230 if not null.
231 .Pp
232 .\" Irccd.Server.prototype.toString
233 The
234 .Fn Irccd.Server.prototype.toString
235 method converts the server to string by returning its unique identifier.
236 Because each server has a unique identifier, this method allows adding a server
237 as property key in maps.
238 .Pp
239 .\" Irccd.Server.prototype.topic
240 The
241 .Fn Irccd.Server.prototype.topic
242 method sets the topic to
243 .Fa topic
244 in the given
245 .Fa channel .
246 .Pp
247 .\" Irccd.Server.prototype.whois
248 The
249 .Fn Irccd.Server.prototype.whois
250 method requests whois information for the
251 .Fa target .
252 This function will generate onWhois event.
253 .Pp
254 .\" EXCEPTIONS
255 .Sh EXCEPTIONS
256 .Bl -tag -width 22n
257 .It Bq Er Irccd.ServerError
258 Thrown on server errors. Usually on invalid arguments.
259 .It Bq Er Error
260 On other errors.
261 .El
262 .\" SEE ALSO
263 .Sh SEE ALSO
264 .Xr irccd-api 3