Code:
on *:text:!?*:#yourchannel:{
  if ($mid($1-,2) ison $chan) {
    yourstuffhere
  }
}