Browse Source

~ parse_mode по умолчанию заменен на html
для markdown слишком много ограничений

Yuriy Zhilovets 5 years ago
parent
commit
1dad1b11d1
1 changed files with 4 additions and 4 deletions
  1. 4 4
      telegram.pl

+ 4 - 4
telegram.pl

@@ -126,9 +126,9 @@ post "/alert" => sub
       $icon = "\x{26A0}";
     }
 
-    my $message .= "$icon ` [" . ($alert->{labels}->{server}||$alert->{labels}->{location}||"") . "] " . $alert->{labels}->{alertname} . " " .$alert->{labels}->{job} 
-                . " " . $alert->{labels}->{instance} . "`\n";
-    $message .= $alert->{annotations}->{summary} . "\n" . "_" . $alert->{annotations}->{description} . "_";  
+    my $message .= "$icon <code> [" . ($alert->{labels}->{server}||$alert->{labels}->{location}||"") . "] " . $alert->{labels}->{alertname} . " " .$alert->{labels}->{job} 
+                . " " . $alert->{labels}->{instance} . "</code>\n";
+    $message .= $alert->{annotations}->{summary} . "\n" . "<i>" . $alert->{annotations}->{description} . "</i>";  
     
     my $rest = {};
     
@@ -323,7 +323,7 @@ sub notify
     disable_web_page_preview => 1,
   };
   
-  $params->{parse_mode} = "MarkdownV2" unless $rest->{parse_mode} && $rest->{parse_mode} eq "none";
+  $params->{parse_mode} = "HTML" unless $rest->{parse_mode} && $rest->{parse_mode} eq "none";
   $params->{reply_to_message_id} = $rest->{msgid} if $rest->{msgid};
   $params->{disable_notification} = 1 if $rest->{silent};