plugin.commands: Fire unhandled-command event

Sat, 22 Jan 2011 17:12:20 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 22 Jan 2011 17:12:20 +0000
changeset 58
3e5b57d44fa0
parent 57
766f4225110b
child 59
dcb0eb6c32b6

plugin.commands: Fire unhandled-command event

plugins/commands.lua file | annotate | diff | comparison | revisions
--- a/plugins/commands.lua	Tue Jan 11 23:35:42 2011 +0100
+++ b/plugins/commands.lua	Sat Jan 22 17:12:20 2011 +0000
@@ -33,6 +33,9 @@
 				room = event.room, -- groupchat support
 			};
 			local ret = bot:event("commands/"..command, command_event);
+			if ret == nil then
+				ret = bot:event("unhandled-command", command_event);
+			end
 			if type(ret) == "string" then
 				event:reply(ret);
 			end

mercurial