Created
November 6, 2012 09:59
-
-
Save joekarma/4023804 to your computer and use it in GitHub Desktop.
Get list (actually, hash table) of IRC channel participants using the cl-irc library. :depends-on (:cl-irc :trivial-timeout)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-channel-users (nickname channel &key username password) | |
(let ((connection (irc:connect :nickname nickname | |
:username username | |
:password password))) | |
(unwind-protect | |
(with-timeout (60) | |
(irc:join connection channel) | |
(irc:add-hook connection 'irc:irc-rpl_endofnames-message | |
(lambda (msg) | |
(declare (ignore msg)) | |
(return-from get-channel-users (irc:users (irc:find-channel connection channel))))) | |
(irc:read-message-loop connection)) | |
(irc:part connection channel) | |
(irc:die connection)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment