(define-public bot:load load-from-path)
+(define (module->string module)
+ (apply (lambda (s . rest)
+ (string-append
+ s
+ (apply string-append
+ (map (lambda (str) (string-append "/" str)) rest))))
+ (map symbol->string module)))
+
(define-public (bot:load-module module-spec)
- (let ((module->string
- (lambda (module)
- (apply
- (lambda (s . rest)
- (string-append
- s
- (apply string-append
- (map (lambda (str) (string-append "/" str)) rest))))
- (map symbol->string module))))
- (new-module
- (make-module))
+ (let ((new-module (make-module 31 (list the-bot-module)))
(old-module (current-module)))
(module-use! new-module the-bot-module)
(set-current-module new-module)
(module-use! (current-module)
(bot:load-module module-spec)))
-
;;; REGEX UTILS
;;; match-not-channel adds a prefix regex to your regex so it doesn't
;;; match-to-me matches text that was addressed to the bot with a
;;; ':',',', or nothing after the bot name
-;(define-public (bot:match-to-me r) r)
(define-public (bot:match-to-me regex)
(string-append (bot:match-not-channel (bot:getnickname))
"[[:space:][:graph:]]*" regex))