for my solution :
(replace BOTID and CHATID with your own)
:execute {
:global urlEncode do={
:local Chars {" "="%20";"!"="%21";"#"="%23";"$"="%24";"%"="%25";"&"="%26";"'"="%27";"("="%28";")"="%29";"+"="%2B";","="%2C";"/"="%2F";":"="%3A";";"="%3B";"<"="%3C";"="="%3D";">"="%3E";"?"="%3F";"@"="%40";"["="%5B";"]"="%5D";"\\0A"="%0A";"\\0D"="%0D";"\\22"="%22"};
:local EncodedStr ""
:for i from=0 to=([:len $1]-1) do={
:local Char [:pick $1 $i]
:local EncChar ($Chars->$Char)
:if ([:len $EncChar] > 0) do={
:set EncodedStr "$EncodedStr$EncChar"
} else={
:set EncodedStr "$EncodedStr$Char"
}
}
:return $EncodedStr
}
:local Message "<b>[TimeAndDate]</b> [Device.NetMaps] [Device.Name]: [Device.FirstAddress] <b>[Probe.Name]</b> status: <b><i>[Service.Status] ([Service.ProblemDescription])</i></b>"
:local myUrl ("https://api.telegram.org/botBOTID/sendMessage\?chat_id=CHATID&parse_mode=HTML&text=" . [$urlEncode $Message])
/tool fetch url=$myUrl keep-result=no http-method=post mode=https
}
help from Google and for html entities replace SPACE and CRLF
feel free to use it
(i'm still using Router OS v6)