set botlisten(port) "3333"
set botlisten(password) "123456"
set botlisten(channel) "#chan"
listen $botlisten(port) script botlisten
proc botlisten {idx} {
control $idx botlisten2
}
proc botlisten2 {idx args} {
global botlisten newTorrentChannel
set args [join $args]
set botlisten(pass) [lindex [split $args] 0]
set botlisten(message) [join [lrange [split $args] 1 end]]
if {[string match $botlisten(pass) $botlisten(password)]} then {
putquick "PRIVMSG $botlisten(channel) :$botlisten(message)"
} else {
putlog "Unauthorized person tried to connect to the bot"
}
}
假设消息有这些字符:ąčęėįšųūž 所以机器人输出奇怪的字符。所以,在我看来,解决方案是添加 utf-8 支持。