From: Janneke Nieuwenhuizen Date: Tue, 15 Aug 2023 08:16:58 +0000 (+0200) Subject: irc: Make irc-bot-init, irc-bot-cleanup methods. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=029a3d6385b240e895501d169930086d964ab057;p=8sync.git irc: Make irc-bot-init, irc-bot-cleanup methods. A bot likely needs to override these. * 8sync/systems/irc.scm (irc-bot-init, irc-bot-cleanup): Change procedures to methods. --- diff --git a/8sync/systems/irc.scm b/8sync/systems/irc.scm index ac4efa6..d13294c 100644 --- a/8sync/systems/irc.scm +++ b/8sync/systems/irc.scm @@ -34,6 +34,7 @@ #:export ( irc-bot-username irc-bot-server irc-bot-channels irc-bot-port + irc-bot-init irc-bot-cleanup dispatch-message handle-message default-irc-port ;REMOVEME compat @@ -80,7 +81,7 @@ (or (slot-ref irc-bot 'realname) (irc-bot-username irc-bot))) -(define (irc-bot-init irc-bot message) +(define-method (irc-bot-init (irc-bot ) message) "Initialize the IRC bot" (define socket (irc:listen (irc-bot-server irc-bot) #:port (irc-bot-port irc-bot) @@ -98,7 +99,7 @@ (<- (actor-id irc-bot) 'main-loop)) -(define (irc-bot-cleanup irc-bot message) +(define-method (irc-bot-cleanup (irc-bot ) message) (close (irc-bot-socket irc-bot))) (define (irc-bot-main-loop irc-bot message)