# HG changeset patch # User Kim Alvefur # Date 1302135648 -7200 # Node ID f86c79cabc752cde8a6b3495749a9c624eeae6fb # Parent 5cb658e37a37c43c562e3a483fdbffe0cfb9fe06# Parent 43ae29f2c69b129054780d5edd21098575b6b60d Merge diff -r 5cb658e37a37 -r f86c79cabc75 plugins/topic.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/topic.lua Thu Apr 07 02:20:48 2011 +0200 @@ -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