I am trying to make a kick that reads from a text file. It is reading the file ok, and it is kicking ok, but only if the word is used by itself, i.e. if there is anything before or after the trigger word it won't kick. I assume there is something wrong with the line;

if ($read(swearwords.txt,w,* $+ $1- $+ *) iswm $1-) {

but I can't figure it out.

Code:
on *:TEXT:*:#:{
  if ($nick isop $chan) || ($me == $nick) { halt }
  if ($read(swearwords.txt,w,* $+ $1- $+ *) iswm $1-) {
    if ($chan == $chr(37) $+ $chr(35) $+ Channel\bName) {
      kick $chan $nick That word is not tolerated in here!
    }
    else { halt }
  }
}


TIA for any help