If you use “url”, “mode” is useless.
<<paste ASCIItoCP1252toURLencode function here>>
:local chat_id ""
:local bot_token ""
:local destination "8.8.8.8"
:local output [/tool traceroute $destination]
:local timestamp [/system clock get time]
:local message [$ASCIItoCP1252toURLencode ("Traceroute to $destination (run at $timestamp):\r\n\r\n$output")]
/tool fetch url="https://api.telegram.org/bot$bot_token/sendMessage\3Fchat_id=$chat_id&text=$message"
You must “escape” the variable for be used on GET parameter.
http://forum.mikrotik.com/t/rextended-fragments-of-snippets/151033/1