plugins/topic.lua

Tue, 21 Oct 2014 19:27:57 +0200

author
Kim Alvefur <zash@zash.se>
date
Tue, 21 Oct 2014 19:27:57 +0200
changeset 115
6498ca5ed831
parent 79
43ae29f2c69b
permissions
-rw-r--r--

plugins.{trac,urltitle,xeps,xkcd,xkcd2,youtube}: Remove net.httpclient_listener, no longer required since verse:8e9f44ecb95b

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

mercurial