summaryrefslogtreecommitdiff
path: root/examples/shell-echo-bot.lisp
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-09-25 15:04:53 -0500
committerBoutade <thegoofist@protonmail.com>2019-09-25 15:04:53 -0500
commit94f31a5e1ff502fa12fb6a27c1f9b8b0854e3ad4 (patch)
treeceaed5ae8ae564686859daf26fcf78587a0ec03c /examples/shell-echo-bot.lisp
parente1b239d0b075bd613a7ea6e321b762dd389e0e5e (diff)
added HARDCOPY slot to CLIENT.
Diffstat (limited to 'examples/shell-echo-bot.lisp')
-rw-r--r--examples/shell-echo-bot.lisp18
1 files changed, 15 insertions, 3 deletions
diff --git a/examples/shell-echo-bot.lisp b/examples/shell-echo-bot.lisp
index f7bca56..6cd9f1b 100644
--- a/examples/shell-echo-bot.lisp
+++ b/examples/shell-echo-bot.lisp
@@ -1,10 +1,22 @@
(defclass shell-echo-bot (granolin:client granolin::message-log) ())
-(defvar *bot* (make-instance 'shell-echo-bot
- :homeserver "https://matrix.hrlo.world"
- :output *standard-output*))
+(defvar *bot*
+ (make-instance 'shell-echo-bot
+ :hardcopy (merge-pathnames ".shell-echo-bot.conf"
+ (user-homedir-pathname))
+ :homeserver "https://matrix.hrlo.world"
+ :output *standard-output*))
+;; a script to login if necessary, and then start the bot
+(unless (access-token *bot*)
+ (princ "Log in to the server:")
+ (terpri)
+ (granolin:login *bot*
+ (and (princ "username: ") (read-line))
+ (and (princ "password: ") (read-line))))
+
+(start *bot*)