# HG changeset patch # User Kim Alvefur # Date 1300654162 -3600 # Node ID 43ae29f2c69b129054780d5edd21098575b6b60d # Parent 65be10a5db6d660b9e8f86dccd83730c9733f6e2 plugins.topic: Lets anyone (no ACL yet) change topic diff -r 65be10a5db6d -r 43ae29f2c69b plugins/topic.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/topic.lua Sun Mar 20 21:49:22 2011 +0100 @@ -0,0 +1,15 @@ +function riddim.plugins.topic(bot) + bot:hook("commands/topic", function(cmd) + local room = cmd.room; + if not room then return "This isn't a room!"; end + if not cmd.param then return room.subject or "No topic here"; end + room:set_subject(cmd.param); + end); + + bot:hook("commands/addtopic", function(cmd) + local room = cmd.room; + if not room then return "This isn't a room!"; end + if not cmd.param then return "What do you want me do add?"; end + room:set_subject((#room.subject>0 and room.subject .. cmd.param) or cmd.param) + end); +end