diff options
author | Boutade <thegoofist@protonmail.com> | 2019-09-29 10:18:05 -0500 |
---|---|---|
committer | Boutade <thegoofist@protonmail.com> | 2019-09-29 10:18:05 -0500 |
commit | e5b24b5eac031b68712c75b463a0e138b617b02d (patch) | |
tree | bd86268343dcf4b4b9c91e87c614ddfd03f4a311 | |
parent | 1d439e258133e6983c13bb1a95c86f9ba31ffd78 (diff) |
prevent attempt to start challenge with unknown user
-rw-r--r-- | examples/roshambot.lisp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/roshambot.lisp b/examples/roshambot.lisp index 2669217..1062302 100644 --- a/examples/roshambot.lisp +++ b/examples/roshambot.lisp @@ -182,7 +182,8 @@ (t ;; otherwise send a direct message to each participant and make a new match instance (let ((challenger-room (ensure-direct-room bot challenger)) (challenged-room (ensure-direct-room bot challenged))) - (if (and (send-text-message + (if (and challenger-room challenged-room + (send-text-message bot challenger-room "You have challenged ~a to roshambo. Reply with Rock, Paper, Scissors or Cancel." @@ -204,7 +205,7 @@ (send-text-message bot room-id "Some kind of problem starting a roshambo match :(")))))) -(defclass roshambo-bot (granolin:client granolin:server-directory roshambot) ()) +(defclass roshambo-bot (granolin:client granolin:server-directory roshambot auto-joiner) ()) ;; (defmethod handle-event :after ((bot roshambot-bot) (ev timeline-event) &optional room-id) ;; (format t "~a - ~a:~% ~a~%" room-id (granolin::sender ev) (granolin:msg-body ev))) |