summaryrefslogtreecommitdiffstats
blob: 2c16214f19a6f134694304b8abcbc6c4b6555674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)