File: badWords.lua

package info (click to toggle)
swift-im 2.0%2Bdev6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,456 kB
  • ctags: 15,521
  • sloc: cpp: 86,078; python: 1,431; xml: 546; sh: 263; ansic: 54; makefile: 42
file content (15 lines) | stat: -rw-r--r-- 402 bytes parent folder | download
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)