IRC Client - Factor Documentation

IRC Client


An IRC Client library

IRC objects:
irc-client


Chat objects:
irc-server-chat

irc-channel-chat

irc-nick-chat


Setup objects:
irc-profile


Words:
connect-irc ( irc-client -- )

terminate-irc ( irc-client -- )

attach-chat ( irc-chat irc-client -- )

detach-chat ( irc-chat -- )

hear ( irc-chat -- message )

speak ( message irc-chat -- )


IRC messages
Some of the RFC defined irc messages as objects:
irc-message base of all irc messages
rpl-welcome logged in to server
ping ping message
join channel join
part channel part
quit quit from irc
privmsg private message (to client or channel)
kick kick from channel
rpl-names list of participants in channel
rpl-nickname-in-use chosen nick is in use by another client
notice notice message
mode mode change
unhandled uninmplemented/unhandled message


Special messages
Some special messages that are created by the library and not by the irc server.
irc-chat-end sent to a chat when it has been detached from the client, the chat should stop after it receives this message.
irc-end sent when the client isn't running anymore, the chat should stop after it receives this message.
irc-disconnected sent to notify chats that connection was lost.
irc-connected sent to notify chats that a connection with the irc server was established.


Example:
USING: irc.client irc.client.chats ; SYMBOL: bot SYMBOL: mychannel ! Create the profile and client objects "irc.libera.chat" irc-port "mybot123" f <irc-profile> <irc-client> bot set ! Connect to the server bot get connect-irc ! Create a channel chat "#mychannel123" <irc-channel-chat> mychannel set ! Register and start chat (this joins the channel) mychannel get bot get attach-chat ! Send a message to the channel "Hello World!" mychannel get speak ! Read a message from the channel mychannel get hear

AltStyle によって変換されたページ (->オリジナル) /