Search code examples
tclirceggdrop

how to set if capture search message is empty


bind pub - "!find" pub:cari

proc pub:cari { nick host hand chan text } {
    set judul [lindex $text 0]
    if { $judul == ""} {
        puthelp "notice $nick :ketik !find <penyanyi/artis>"
        return
    } else {
        putquick "notice $nick :being processed $judul"
        catch [list exec find /home/gusman/mp3 -name "*$judul*" -type f -printf "%f\n"] data
        putserv "notice $nick :!putar $data"
        putserv "notice $nick :copy paste di channel !putar $data"
    }
}

putlog "find.tcl"

if sought is in the data it works well to post to the target. if the searched in data is empty, it does not work, please indicate whether this scripts is incomplete or wrong.


Solution

  • I've got the solution on this line:

    if { $judul == ""}