1 ! Copyright (C) 2008 William Schlieper
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel vocabs.loader sequences strings splitting words irc.messages ;
6 IN: irc.ui.commandparser
8 : command ( string string -- string command )
10 dup "irc.ui.commands" lookup
12 [ " " append prepend "quote" "irc.ui.commands" lookup ] if* ;
14 : parse-message ( string -- )
15 "/" ?head [ " " split1 swap command ] [ "say" command ] if execute ;