set triggers "hi hello hiya"
foreach c $triggers {
 bind pubm - $c pub:reply_hello
}
proc pub:reply_hello {nick host hand chan text} {
 if {[catch {set contents [split [read [set f [open hi.txt r]]] \n ] ; close $f}]} {
   putserv "PRIVMSG $chan :[string map "<nick> $nick" [lindex $contents [rand [expr [llength $contents] - 1]]]]"
 } else { putserv "PRIVMSG $chan :i was not able to do it" }
}