bind pub - "+youtube" youtube_url
proc youtube_url {nick uhost handle channel text arg} {
set url_regex {(https?://www\.youtube\.com/watch\?v=[a-zA-Z0-9_-]+)}
if {[regexp $url_regex $arg url]} {
set modified_url [string map {"youtube.com/watch?v=" "youtubepp.com/watch?v="} $url]
putnow "PRIVMSG $channel :@ $nick, here is the youtube change link: $modified_url"
}
}
Purpose of the script is that if someone post youtube url in channel, bot reply with same url but added pp after youtube.
But when loaded it, nothing happens when someone post youtube url. Please some help