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

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

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