From: plugd Date: Fri, 1 Sep 2023 13:58:50 +0000 (+0200) Subject: Updated pgbot example. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=72ee79ea430896a729cdeb5ecaafbef0fb75141c;p=botbot.git Updated pgbot example. --- diff --git a/examples/pgbot.scm b/examples/pgbot.scm index 20b5658..9c833ac 100644 --- a/examples/pgbot.scm +++ b/examples/pgbot.scm @@ -34,25 +34,25 @@ (lambda (source args privmsg) (match (string-split (car args)) (("hello") - (privmsg source "hello yourself!")) + (privmsg source (conc "Hello, " source "!"))) - ((",seturl" url) + (("seturl" url) (set-url source url) - (privmsg source "updated url")) + (privmsg source "Updated your URL. Thanks!")) - ((",geturl" nick) + (("geturl" nick) (print "in geturl") (privmsg source (let ((url (get-url nick))) (if url (conc "URL for " nick ": " url) - (conc "No URL for " nick " in database"))))) + (conc "No URL for " nick " in database."))))) - ((",rmurl") + (("rmurl") (clear-url source) - (privmsg source "cleared url")) + (privmsg source "Deleted your nick and url from database.")) - ((",list") + (("list") (if (null? url-alist) (privmsg source "No registered phlog/gemlog/blog URLs. :(") (begin @@ -64,17 +64,19 @@ (privmsg source (conc " " nick ": " url)))) url-alist)))) - ((",announce") + (("announce") (let ((url (get-url source))) (if url (privmsg "#phloggersgarage" (conc source " has published a new post at " url "!")) - (privmsg source "Register your *log URL first using ,seturl .")))) + (privmsg source "Register your *log URL first using seturl .")))) (_ - (privmsg source "Beep boop! Here are the valid pgbot commands:") - (privmsg source " ,seturl [url] : Save your *log URL for others to see") - (privmsg source " ,rmurl : Remove your *log URL if one is saved.") - (privmsg source " ,geturl [nick] : Retrieve the *log URL belonging to [nick].") - (privmsg source " ,list : List all currently stored *log URLs.") - (privmsg source " ,announce : Announce a new *log entry to #phloggersgarage! Huzzah!"))))) + (privmsg source "Beep boop! This is pgbot, the #phloggersgarage bot.") + (privmsg source "To use pgbot, send it a message: \x02/msg pgbot command\x02.") + (privmsg source "Here are the currently-valid pgbot commands:") + (privmsg source " \x02seturl [url]\x02: Save your *log URL for others to see") + (privmsg source " \x02rmurl\x02: Remove your *log URL if one is saved.") + (privmsg source " \x02geturl [nick]\x02: Retrieve the *log URL belonging to [nick].") + (privmsg source " \x02list\x02: List all currently stored *log URLs.") + (privmsg source " \x02announce\x02: Announce a new *log entry to #phloggersgarage! Huzzah!")))))