summaryrefslogtreecommitdiff
path: root/examples/shell-echo-bot.lisp
diff options
context:
space:
mode:
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*)