This is the trivial-irc Reference Manual, version 0.0.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Jul 15 06:55:08 2025 GMT+0.
The main system appears first, followed by any subsystem dependency.
trivial-ircA trivial IRC client library with simple facilities for
receiving, handling and sending messages, and without facilities for CTCP.
Thomas Stenhaug <thomas.stenhaug@gmail.com>
Thomas Stenhaug <thomas.stenhaug@gmail.com>
MIT
0.0.4
cl-ppcre (system).
split-sequence (system).
usocket (system).
package.lisp (file).
replies.lisp (file).
client.lisp (file).
Files are sorted by type and then listed depth-first from the systems components trees.
trivial-irc/trivial-irc.asdtrivial-irc/package.lisptrivial-irc/replies.lisptrivial-irc/client.lisptrivial-irc/replies.lisppackage.lisp (file).
trivial-irc (system).
*reply-number->reply-name* (special variable).
find-reply-name (function).
trivial-irc/client.lispreplies.lisp (file).
trivial-irc (system).
client (class).
connect (generic function).
connected-p (generic function).
connection-closed (condition).
connection-failed (condition).
connection-lost (condition).
define-handler (macro).
disconnect (generic function).
handle (generic function).
nickname (generic reader).
parse-prefix (function).
prefix-nickname (function).
prefix-servername (function).
receive-message (generic function).
send-join (generic function).
send-pong (generic function).
send-privmsg (generic function).
send-raw-message (function).
*default-quit-message* (special variable).
*message-scanner* (special variable).
*version* (special variable).
.nick (function).
.password (function).
.quit (function).
.user (function).
change-nick (generic function).
parse-argument-string (function).
parse-raw-message (function).
receive-raw-message (function).
record (function).
socket (generic reader).
universal-time->iso-8601-string (function).
with-client-stream (macro).
Packages are listed by definition order.
trivial-ircTrivial IRC client library.
See ‘examples/echobot/’ in the distribution directory for a simple
example of how to use it.
Currently, the exposed API is a very thin abstraction of the IRC
protocol, and you probably need the IRC RFC to make use of it.
The current version was slapped together in a few hours, to fill a
specific need I had. It’s not certain that it will evolve with much,
but I’m open to suggestions and requests.
If you have a better fit for trivial-irc and want to claim the name, just let me know and I’ll retire this.
common-lisp.
client (class).
connect (generic function).
connected-p (generic function).
connection-closed (condition).
connection-failed (condition).
connection-lost (condition).
define-handler (macro).
disconnect (generic function).
handle (generic function).
nickname (generic reader).
parse-prefix (function).
prefix-nickname (function).
prefix-servername (function).
receive-message (generic function).
send-join (generic function).
send-pong (generic function).
send-privmsg (generic function).
send-raw-message (function).
*default-quit-message* (special variable).
*message-scanner* (special variable).
*reply-number->reply-name* (special variable).
*version* (special variable).
.nick (function).
.password (function).
.quit (function).
.user (function).
change-nick (generic function).
find-reply-name (function).
parse-argument-string (function).
parse-raw-message (function).
receive-raw-message (function).
record (function).
socket (generic reader).
universal-time->iso-8601-string (function).
with-client-stream (macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Define handling for @c(command).
This is currently a convenience for specializing on the generic function @c(handle). An example is the handler for PING messages (which by default is the only handler specialization).
@begin[lang=lisp](code)
(define-handler (:ping client prefix arguments)
(send-pong client (first arguments)))
@end(code)
If you wanted to use a different variable-name for the client
variable, you could also have written it as
@begin[lang=lisp](code)
(define-handler (:ping (client client) prefix arguments)
(send-pong client (first arguments)))
@end(code)
Return a list of the components in prefix.
The elements of the list are as follows:
@begin(list)
@item(servername or nickname as string)
@item(username string, or @c(nil))
@item(a hostname string, or @c(nil))
@end(list)
Send @cl:param(raw-message) and CRLF to the socket associated with @cl:param(client).
Outside of the few send-* functions, this is what you have to use to
send messages to the server.
Connect and register @cl:param(client) with an IRC server.
This also sets up some of the slots, and opens the log-stream.
Return @c(t) if @cl:param(client) is connected, @c(nil) otherwise.
Send QUIT message to server, close the socket and close the log-stream.
Always signals @c(connection-closed).
Called by @c(receive-message) after parsing the raw message.
Specialize on this function with the macro @c(define-handler) for customizing
behaviour.
There is a default method that spits out the unhandled message
to @c(*standard-output*).
Return current nickname of @cl:param(client).
Read a message from @i(connection), parse it,
@c(handle), and return a list with the following 3 elements:
@begin(enum)
@item(the raw prefix string, or @c(nil) if prefix wasn’t present)
@item(@i(command) is a keyword with a name corresponding to the command from the RFC and)
@item(@i(parsed-parameters) is a list of strings representing the arguments in the message.)
@end(enum)
If an error occurs during the reading, the client will be
disconnected, and @c(connection-closed) will be signalled.
Send JOIN message.
Send PONG command to server.
Send @cl:param(message) to @cl:param(victim), where @cl:param(victim) is either a channel- or nick-name.
Signalled by the @c(disconnect) function.
Disconnecting is the default action whenever an error occurs, so this signal can for example be handled to reconnect.
condition.
Client whose connection was closed
:client
Signalled by @c(connect).
Signalled when connection is lost.
Currently signalled when an error occurs during trying to receive a message from the server.
error.
Client whose connection was lost
:client
A client connection to an IRC server.
Valid initargs are:
@begin(list)
@item(@c(:nickname) – the nickname use when connecting (required))
@item(@c(:server) – the hostname of the server to connect to as a string (required))
@item(@c(:port) – the port to connect to as an integer (optional))
@item(@c(:username) – the username to register with (optional))
@item(@c(:realname) – the realname to register with (optional))
@item(@c(:password) – the password to regiseter with (optional))
@item(@c(:log-pathname) – pathname for packet-log pathname (optional))
@end(list)
Please note that you call @c(connect) on a @c(client) instance, rather than having @c(connect) return a @c(client) instance.
Nickname of client (mandatory). Sent at beginning of connection, and by @c(change-nick)
(error "must supply :nickname")
:nickname
This slot is read-only.
Password used during registration (optional)
:password
Username sent at beginning of connection. Defaults to nickname.
:username
Realname sent at beginning of connection. Defaults to username.
:realname
Address of the IRC server
(error "must supply :server")
:server
Port of client connection
6667
:port
Socket of an active connection
:socket
This slot is read-only.
Pathname of log-file
:log-pathname
Stream of log-file
Send /client/’s nickname to server.
Called by ‘connect’ during registration.
Send /client/’s password if a password is associated with /client/.
Send /client/’s username and realname to server.
Called by ‘connect’ during registration.
Return a list on the form (prefix command arguments).
@begin(enum)
@item(prefix) can be @c(nil), or servername / ( nickname [ [ "!" user ] "@" host ]
See also the @c(parse-prefix) function.
@item(command) is a keyword either made from the alpha-characters, or a
keyword looked up with @c(find-reply-name).
@item(arguments) is a list of the command arguments.
@end(enum)
Receive and return a single, raw message from @cl:param(client).
If any errors occur during the reading, the connection is silently shut down.
| Jump to: | .
C D F G H M N P R S U W |
|---|
| Jump to: | .
C D F G H M N P R S U W |
|---|
| Jump to: | *
C E L N P R S U |
|---|
| Jump to: | *
C E L N P R S U |
|---|
| Jump to: | C F P R S T |
|---|
| Jump to: | C F P R S T |
|---|