summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-07-21 19:31:16 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-07-21 19:36:20 (GMT)
commit053128df5c36b80c35e8ec5483125305f8fc86ea (patch)
tree1eefb685b32dba1816501d72733dedbdf2717e08 /Swiftob/scripts
parent12024c66fe21c62b158552abe26b1bcfa142ffe8 (diff)
downloadswift-053128df5c36b80c35e8ec5483125305f8fc86ea.zip
swift-053128df5c36b80c35e8ec5483125305f8fc86ea.tar.bz2
Adding MUC kicking support to Swiftob bots
Diffstat (limited to 'Swiftob/scripts')
-rw-r--r--Swiftob/scripts/badWords.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/Swiftob/scripts/badWords.lua b/Swiftob/scripts/badWords.lua
new file mode 100644
index 0000000..2c16214
--- /dev/null
+++ b/Swiftob/scripts/badWords.lua
@@ -0,0 +1,15 @@
+function bad_words(body, muc, nick, message)
+ words = {"sbwriel"}
+ print("Received line from '" .. nick .. "' in '" .. muc .. "':")
+ print(body)
+
+ for _, word in pairs(words) do
+ if string.len(string.match(body, word)) > 0 then
+ --swiftob_reply_to(message, "Kicking "..nick.." for bad word "..word)
+ swiftob_muc_kick(muc, nick)
+ end
+ end
+end
+
+swiftob_register_listener(bad_words)
+