summaryrefslogtreecommitdiff
path: root/examples/shell-echo-bot.lisp
blob: 6cd9f1be24777c4131fa6e97e1c699e152d8262b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

(defclass shell-echo-bot (granolin:client granolin::message-log) ())

(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*)