]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Reply.pl
urlchannel
[infobot.git] / src / Factoids / Reply.pl
index 89faac20de8f0600bf0eba97af5d636d3e2af0fa..b892a5ee0bb0b37632a238e1a4003a9041c4b0c2 100644 (file)
@@ -314,6 +314,11 @@ sub substVars {
         $reply =~ s/\$host(name)?/$hostname/g;
     }
     $reply =~ s/\$chan(nel)?/$talkchannel/g;
+    if ( $reply =~ /\$urlchannel/ ) {
+       my $urlchannel = $talkchannel;
+        $urlchannel =~ s/([^\w])/sprintf("%%%02x",ord($1))/gie;
+       $reply =~ s/\$urlchannel?/$urlchannel/g;
+    }
     if ( $msgType =~ /public/ ) {
         $reply =~ s/\$lastspeaker/$lastWho{$talkchannel}/g;
     }