1irc(n)                    Low Level Tcl IRC Interface                   irc(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       irc - Create IRC connection and interface.
9

SYNOPSIS

11       package require Tcl
12
13       package require irc  ?0.6?
14
15       ::irc::config ?key? ?value?
16
17       ::irc::connection
18
19       ::irc::connections
20
21       ::irc::destroy net
22
23       net registerevent event script
24
25       net getevent event script
26
27       net eventexists event script
28
29       net connect hostname ?port?
30
31       net config ?key? ?value?
32
33       net log level message
34
35       net logname
36
37       net connected
38
39       net sockname
40
41       net peername
42
43       net socket
44
45       net user username localhostname localdomainname userinfo
46
47       net nick nick
48
49       net ping target
50
51       net serverping
52
53       net join channel ?key?
54
55       net part channel ?message?
56
57       net quit ?message?
58
59       net privmsg target message
60
61       net notice target message
62
63       net ctcp target message
64
65       net kick channel target ?message?
66
67       net mode target args
68
69       net topic channel message
70
71       net invite channel target
72
73       net send text
74
75       who ?address?
76
77       action
78
79       target
80
81       additional
82
83       header
84
85       msg
86
87_________________________________________________________________
88

DESCRIPTION

90       This  package provides low-level commands to deal with the IRC protocol
91       (Internet Relay Chat) for immediate and interactive multi-cast communi‐
92       cation.
93
94       ::irc::config ?key? ?value?
95              Sets configuration ?key? to ?value?. The configuration keys cur‐
96              rently defined are the boolean flags logger and  debug.   logger
97              makes  irc  use  the  logger  package  for printing error. debug
98              requires logger and prints extra debug output.  If no  ?key?  or
99              ?value? is given the current values are returned.
100
101       ::irc::connection
102              The command creates a new object to deal with an IRC connection.
103              Creating this IRC object does not automatically create the  net‐
104              work  connection.   It returns a new irc namespace command which
105              can be used to interact with the new IRC connection.  NOTE:  the
106              old  form  of  the connection command, which took a hostname and
107              port as arguments, is deprecated.  Use connect instead to  spec‐
108              ify this information.
109
110       ::irc::connections
111              Returns  a list of all the current connections that were created
112              with connection
113
114       ::irc::destroy net
115              Deletes a connection and its associated namespace  and  informa‐
116              tion.
117

Per-connection Commands

119       In  the following list of available connection methods net represents a
120       connection command as returned by ::irc::connection.
121
122       net registerevent event script
123              Registers a callback handler for  the  specific  event.   Events
124              available  are  those  described in RFC 1459 http://www.rfc-edi
125              tor.org/rfc/rfc1459.txt.  In addition, there are  several  other
126              events  defined.  defaultcmd adds a command that is called if no
127              other callback is present.  EOF is called if the connection sig‐
128              nals an End of File condition. The events defaultcmd, defaultnu‐
129              meric, and defaultevent are required.  script is executed in the
130              connection  namespace,  which can take advantage of several com‐
131              mands (see Callback Commands below) to aid  in  the  parsing  of
132              data.
133
134       net getevent event script
135              Returns  the current handler for the event if one exists. Other‐
136              wise an empty string is returned.
137
138       net eventexists event script
139              Returns a boolean value indicating the existence  of  the  event
140              handler.
141
142       net connect hostname ?port?
143              This  causes  the  socket  to be established.  ::irc::connection
144              created the namespace and the commands to be used, but  did  not
145              actually  open  the  socket. This is done here.  NOTE: the older
146              form of ´connect' did not require the user to specify a hostname
147              and  port, which were specified with 'connection'.  That form is
148              deprecated.
149
150       net config ?key? ?value?
151              The same as ::irc::config but sets and gets options for the  net
152              connection only.
153
154       net log level message
155              If  logger  is turned on by config this will write a log message
156              at level.
157
158       net logname
159              Returns the name of the logger instance if logger is turned on.
160
161       net connected
162              Returns a boolean value indicating if this  connection  is  con‐
163              nected to a server.
164
165       net sockname
166              Returns a 3 element list consisting of the ip address, the host‐
167              name, and the port of the local end of the connection,  if  cur‐
168              rently connected.
169
170       net peername
171              Returns a 3 element list consisting of the ip address, the host‐
172              name, and the port of the remote end of the connection, if  cur‐
173              rently connected.
174
175       net socket
176              Return the Tcl channel for the socket used by the connection.
177
178       net user username localhostname localdomainname userinfo
179              Sends USER command to server.  username is the username you want
180              to appear.  localhostname is the host portion of your  hostname,
181              localdomainname  is  your  domain  name, and userinfo is a short
182              description of who you are. The 2nd and 3rd arguments  are  nor‐
183              mally ignored by the IRC server.
184
185       net nick nick
186              NICK command.  nick is the nickname you wish to use for the par‐
187              ticular connection.
188
189       net ping target
190              Send a CTCP PING to target.
191
192       net serverping
193              PING the server.
194
195       net join channel ?key?
196              channel is the IRC channel  to  join.   IRC  channels  typically
197              begin with a hashmark ("#") or ampersand ("&").
198
199       net part channel ?message?
200              Makes  the  client  leave channel. Some networks may support the
201              optional argument message
202
203       net quit ?message?
204              Instructs the IRC server to close the  current  connection.  The
205              package will use a generic default if no message was specified.
206
207       net privmsg target message
208              Sends  message  to  target,  which  can  be either a channel, or
209              another user, in which case their nick is used.
210
211       net notice target message
212              Sends a notice with message message  to  target,  which  can  be
213              either  a  channel, or another user, in which case their nick is
214              used.
215
216       net ctcp target message
217              Sends a CTCP of type message to target
218
219       net kick channel target ?message?
220              Kicks the user target from the channel channel with  a  message.
221              The latter can be left out.
222
223       net mode target args
224              Sets  the  mode args on the target target. target may be a chan‐
225              nel, a channel user, or yourself.
226
227       net topic channel message
228              Sets the topic on channel to message specifying an empty  string
229              will remove the topic.
230
231       net invite channel target
232              Invites target to join the channel channel
233
234       net send text
235              Sends text to the IRC server.
236

Callback Commands

238       These commands can be used within callbacks
239
240       who ?address?
241              Returns  the  nick  of  the  user  who performed a command.  The
242              optional keyword address causes the command to return  the  user
243              in the format "username@address".
244
245       action Returns  the  action  performed,  such  as  KICK, PRIVMSG, MODE,
246              etc...  Normally not useful, as callbacks are bound to a partic‐
247              ular event.
248
249       target Returns  the target of a particular command, such as the channel
250              or user to whom a PRIVMSG is sent.
251
252       additional
253              Returns a list of any additional arguments after the target.
254
255       header Returns the entire event header (everything up to the  :)  as  a
256              proper list.
257
258       msg    Returns  the  message portion of the command (the part after the
259              :).
260

SEE ALSO

262       rfc 1459
263

KEYWORDS

265       chat, irc
266
267
268
269irc                                   0.6                               irc(n)
Impressum