USING: irc.client kernel threads fry alarms calendar prettyprint ; IN: testbot : bot-profile ( -- obj ) "irc.freenode.org" 6667 "testbot" f ; : bot-channel ( -- seq ) "#testbot-test" ; GENERIC: handle-message ( msg -- ) #! Changing the '.' to drop and doing a refresh-all doesn't stop the prettyprints M: object handle-message . ; : bot-loop ( chat -- ) dup hear handle-message bot-loop ; : start-bot ( -- chat ) bot-profile [ connect-irc ] [ [ bot-channel dup ] dip '[ _ [ _ attach-chat ] [ bot-loop ] bi ] "Testbot" spawn drop ] bi ; : testbot ( -- ) start-bot '[ _ drop ] 5 minutes every drop ; MAIN: testbot