Code: Select all
bind pub - !calc calc
proc calc { nick uhost hand chan arg } {
if {[llength $arg]==0} {
return 0
}
set result [expr $arg]
putserv "PRIVMSG $chan :$nick: $result"
}
!calc 4 / 0
This returns the following in botnet (and nothing to the channel):
Tcl error [calc]: divide by zero
I would like this to print out to the channel instead. Is it possible to do output redirection like this?