From cfbf58dbee13a6eb7eb282f3b2f666d43a147367 Mon Sep 17 00:00:00 2001 From: plugd Date: Mon, 4 Sep 2023 21:48:16 +0200 Subject: [PATCH] Fixed line buffering, added example. --- botbot.scm | 1 + examples/hello_world.scm | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 examples/hello_world.scm diff --git a/botbot.scm b/botbot.scm index 187f0cb..a03ea80 100644 --- a/botbot.scm +++ b/botbot.scm @@ -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 index 0000000..6f26ff1 --- /dev/null +++ b/examples/hello_world.scm @@ -0,0 +1,5 @@ +;; Basic hello-world bot: + +(lambda (source args privmsg) + (if (string=? (car args) "hello") + (privmsg source "Bonjour!"))) -- 2.20.1