1 USING: help.markup help.syntax quotations kernel ;
4 HELP: irc-client "IRC Client object"
7 HELP: irc-server-listener "Listener for server messages unmanaged by other listeners"
10 HELP: irc-channel-listener "Listener for irc channels"
13 HELP: irc-nick-listener "Listener for irc users"
16 HELP: irc-profile "IRC Client profile object"
19 HELP: connect-irc "Connecting to an irc server"
20 { $values { "irc-client" "an irc client object" } }
21 { $description "Connects and logins " { $link irc-client } " using the settings specified on its " { $link irc-profile } "." } ;
23 HELP: add-listener "Listening to irc channels/users/etc"
24 { $values { "irc-client" "an irc client object" } { "irc-listener" "an irc listener object" } }
25 { $description "Registers " { $snippet "irc-listener" } " with " { $snippet "irc-client" } " and starts listening." } ;
27 HELP: terminate-irc "Terminates an irc client"
28 { $values { "irc-client" "an irc client object" } }
29 { $description "Terminates all activity by " { $link irc-client } " cleaning up resources and notifying listeners." } ;
31 ARTICLE: "irc.client" "IRC Client"
32 "An IRC Client library"
33 { $heading "IRC objects:" }
34 { $subsection irc-client }
35 { $heading "Listener objects:" }
36 { $subsection irc-server-listener }
37 { $subsection irc-channel-listener }
38 { $subsection irc-nick-listener }
39 { $heading "Setup objects:" }
40 { $subsection irc-profile }
42 { $subsection connect-irc }
43 { $subsection terminate-irc }
44 { $subsection add-listener }
45 { $heading "IRC messages" }
46 "Some of the RFC defined irc messages as objects:"
48 { { $link irc-message } "base of all irc messages" }
49 { { $link logged-in } "logged in to server" }
50 { { $link ping } "ping message" }
51 { { $link join } "channel join" }
52 { { $link part } "channel part" }
53 { { $link quit } "quit from irc" }
54 { { $link privmsg } "private message (to client or channel)" }
55 { { $link kick } "kick from channel" }
56 { { $link roomlist } "list of participants in channel" }
57 { { $link nick-in-use } "chosen nick is in use by another client" }
58 { { $link notice } "notice message" }
59 { { $link mode } "mode change" }
60 { { $link unhandled } "uninmplemented/unhandled message" }
62 { $heading "Special messages" }
63 "Some special messages that are created by the library and not by the irc server."
65 { { $link irc-end } " sent when the client isn't running anymore, listeners should stop after this." }
66 { { $link irc-disconnected } " sent to notify listeners that connection was lost." }
67 { { $link irc-connected } " sent to notify listeners that a connection with the irc server was established." } }
69 { $heading "Example:" }
71 "USING: irc.client concurrency.mailboxes ;"
74 "! Create the profile and client objects"
75 "\"irc.freenode.org\" irc-port \"mybot123\" f <irc-profile> <irc-client> bot set"
76 "! Connect to the server"
78 "! Create a channel listener"
79 "\"#mychannel123\" <irc-channel-listener> mychannel set"
80 "! Register and start listener (this joins the channel)"
81 "bot get mychannel get add-listener"
82 "! Send a message to the channel"
83 "\"what's up?\" mychannel get out-messages>> mailbox-put"
84 "! Read a message from the channel"
85 "mychannel get in-messages>> mailbox-get"