From: plugd Date: Mon, 4 Sep 2023 19:48:16 +0000 (+0200) Subject: Fixed line buffering, added example. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;ds=inline;p=botbot.git Fixed line buffering, added example. --- 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!")))