Fixed line buffering, added example. master
authorplugd <plugd@thelambdalab.xyz>
Mon, 4 Sep 2023 19:48:16 +0000 (21:48 +0200)
committerplugd <plugd@thelambdalab.xyz>
Mon, 4 Sep 2023 19:48:16 +0000 (21:48 +0200)
botbot.scm
examples/hello_world.scm [new file with mode: 0644]

index 187f0cb..a03ea80 100644 (file)
@@ -46,6 +46,7 @@
 
 (define (launch-bot)
   ;; (let-values (((in-port out-port) (tcp-connect host port)))
+  (set-buffering-mode! (current-output-port) #:line)
   (let-values (((in-port out-port)
                 (if usetls
                     (ssl-connect* hostname: irc-host port: (or irc-port 6697))
diff --git a/examples/hello_world.scm b/examples/hello_world.scm
new file mode 100644 (file)
index 0000000..6f26ff1
--- /dev/null
@@ -0,0 +1,5 @@
+;; Basic hello-world bot:
+
+(lambda (source args privmsg)
+  (if (string=? (car args) "hello")
+      (privmsg source "Bonjour!")))