? bot-fixes.patch
? current-state.patch
? current.patch
? dist.sh
? msg
? tracking.patch
? tracking.patch2
? tracking.patch3
? working-track.lisp
? doc/tracking-considerations
? test/package.fasl
? test/test-parse-message.fasl
? test/test-protocol.fasl
RCS file: /project/cl-irc/cvsroot/cl-irc/package.lisp,v
retrieving revision 1.10
diff -u -r1.10 package.lisp
|
|
|
15 | 15 | :irc-message-event |
16 | 16 | :start-background-message-handler |
17 | 17 | :stop-background-message-handler |
| 18 | :destructuring-arguments |
18 | 19 | :socket-connect |
19 | 20 | :server-name |
20 | 21 | :no-such-reply |
RCS file: /project/cl-irc/cvsroot/cl-irc/example/cliki.lisp,v
retrieving revision 1.38
diff -u -r1.38 cliki.lisp
|
|
|
723 | 723 | |
724 | 724 | |
725 | 725 | (defun valid-cliki-message (message) |
726 | | (scan *cliki-attention-prefix* (trailing-argument message))) |
| 726 | (scan *cliki-attention-prefix* (car (last (arguments message))))) |
727 | 727 | |
728 | 728 | (defvar *respond-to-general-hellos* nil) |
729 | 729 | |
… |
… |
|
740 | 740 | (format *trace-output* "~A~%" |
741 | 741 | (nthcdr 10 (sb-debug:backtrace-as-list))) |
742 | 742 | (return-from msg-hook)))) |
743 | | (progn |
744 | | (scan-for-more (trailing-argument message)) |
745 | | (let ((respond-to (if (string-equal (first (arguments message)) *cliki-nickname*) (source message) (first (arguments message))))) |
| 743 | (destructuring-arguments |
| 744 | (target &rest unused &last text) |
| 745 | message |
| 746 | (declare (ignore unused)) |
| 747 | (scan-for-more text) |
| 748 | (let ((respond-to (if (string-equal target *cliki-nickname*) (source message) target))) |
746 | 749 | (if (valid-cliki-message message) |
747 | | (let ((response (cliki-lookup (regex-replace *cliki-attention-prefix* (trailing-argument message) "") :sender (source message) :channel (first (irc:arguments message))))) |
| 750 | (let ((response (cliki-lookup (regex-replace *cliki-attention-prefix* text "") :sender (source message) :channel target))) |
748 | 751 | (and response (privmsg *cliki-connection* respond-to response))) |
749 | | (if (string-equal (first (arguments message)) *cliki-nickname*) |
750 | | (aif (cliki-lookup (trailing-argument message) :sender (source message)) |
| 752 | (if (string-equal target *cliki-nickname*) |
| 753 | (aif (cliki-lookup text :sender (source message)) |
751 | 754 | (privmsg *cliki-connection* respond-to it)) |
752 | | (if (anybody-here (trailing-argument message)) |
753 | | (privmsg *cliki-connection* (first (arguments message)) (format nil "~A: hello." (source message)))))) |
| 755 | (if (anybody-here text) |
| 756 | (privmsg *cliki-connection* target (format nil "~A: hello." (source message)))))) |
754 | 757 | (take-care-of-memos respond-to (source message)))))) |
755 | 758 | |
756 | 759 | (defvar *cliki-nickserv-password* "") |
757 | 760 | |
758 | 761 | (defun notice-hook (message) |
759 | 762 | (if (and (string-equal (source message) "NickServ") |
760 | | (scan "owned by someone else" (trailing-argument message))) |
| 763 | (scan "owned by someone else" (car (last (arguments message))))) |
761 | 764 | (privmsg *cliki-connection* (source message) (format nil "IDENTIFY ~A" *cliki-nickserv-password*)))) |
762 | 765 | |
763 | 766 | (defun rename-cliki (new-nick) |
RCS file: /project/cl-irc/cvsroot/cl-irc/example/specbot.lisp,v
retrieving revision 1.14
diff -u -r1.14 specbot.lisp
|
|
|
102 | 102 | (and (not final) string)) |
103 | 103 | |
104 | 104 | (defun msg-hook (message) |
105 | | (let ((destination (if (string-equal (first (arguments message)) *nickname*) |
106 | | (source message) |
107 | | (first (arguments message)))) |
| 105 | (let* ((target (first (arguments message)))) |
| 106 | (destination (if (string-equal target *nickname*) |
| 107 | (source message) |
| 108 | target)) |
108 | 109 | (to-lookup (strip-address (trailing-argument message)))) |
109 | 110 | (if (and (or |
110 | | (string-equal (first (arguments message)) *nickname*) |
| 111 | (string-equal target *nickname*) |
111 | 112 | (not (string= to-lookup (trailing-argument message)))) |
112 | 113 | (member to-lookup '("help" "help?") :test #'string-equal)) |
113 | 114 | (progn |