rendered paste bodybind pub o !trac puturl
proc definetopic {nick uhost hand chan args} {
set ticURL "http://trac.xbmc.org/ticket/"
set revURL "http://trac.xbmc.org/changeset/"
# check permission
if [ ! regexp -nocase {.*@xbmc/staff/.*] $uhost ] then {
puthelp "NOTICE $nick : You don't have permission to use !trac"
return
}
# Usage Details
if {[lindex $args 0] == "" } {
puthelp "NOTICE $nick : Usage: !trac [#NNNN|rNNNNN]"
return
}
# parse request
set URL ""
if [ regexp {r(\d+)} $args[0] match rev ] then {
set URL $revURL+$rev
} else {
if [ regexp {#(\d+)} $args[0] match ticket ] then {
set URL $ticURL+$ticket
}
}
# print result
if [ $URL != "" ] then {
puthelp "NOTICE $nick : "+$URL
}
return
}