summaryrefslogtreecommitdiff
path: root/examples/shell-echo-bot.lisp
blob: a73a1748a04362c204b20507550691ac6174ab9b (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 (granolin:logged-in-p *bot*) 
  (princ "Log in to the server:")
  (terpri)
  (granolin:login *bot*
                  (and (princ "username: ") (read-line))
                  (and (princ "password: ") (read-line))))


(granolin:start *bot*)