The irc library allows you to develop IRC clients and communicate over IRC.
To use the IRC client library, first create a connection with irc-connect . For example, to connect to the Libera.Chat network (irc.libera.chat, port 6667) with nickname "rackbot", username "rbot", and real name "Racket Bot", do
This defines an irc-connection object which must be used for all future communication with this server, as well as an event that will be ready for synchronization when the server is ready to accept more commands (i.e. when the connection has been fully established).
Once the returned event fires, you can use other IRC commands. For example, if you have a connection object named connection, you can join the #racket channel with
(irc-join-channel connection"#racket")
Once you have joined, you can send a message on that channel with the following:
(irc-send-message connection"#racket""Hello, world!")
struct
(struct irc-message (prefixcommandparameterscontent))
command:string?content:string?
procedure
( irc-connection? object)→boolean?
object:any
procedure
portnickusernamereal-name[ #:return-eofreturn-eofserver:string?nick:string?username:string?real-name:string?= #f
procedure
( irc-connection-incoming connection)→async-channel?
connection:irc-connection?
procedure
( irc-join-channel connectionchannel)→void?
connection:irc-connection?channel:string?
procedure
( irc-part-channel connectionchannel)→void?
connection:irc-connection?channel:string?
procedure
( irc-send-message connectiontargetmessage)→void?
connection:irc-connection?target:string?message:string?
procedure
( irc-send-notice connectiontargetnotice)→void?
connection:irc-connection?target:string?notice:string?
procedure
port[ #:return-eofreturn-eofhost:string?= #f
Use this form instead of irc-connect when you want more control over when to send the NICK and USER commands.
procedure
( irc-set-nick connectionnick)→void?
connection:irc-connection?nick:string?
procedure
usernameconnection:irc-connection?username:string?real-name:string?
connection:irc-connection?
procedure
commandconnection:irc-connection?command:string?args:string?
CTCP is an embeded protocol within IRC that allows for actions such as /me commands. This package currently has basic support for CTCP.
procedure
( ctcp-actionconnectiontargetaction)→void?
connection:irc-connection?target:string?action:string?
For more information on the IRC client protocol, see RFC 2812.