Hello
I’m trying to send a message from Mikrotik to my telegram group using bot
[ I already added a new Traffic Monitor] my OS version is: 6.47.10
and this is the script:
/tool fetch
url=“https://api.telegram.org/bot/sendMessage?chat_id=<Chat_ID>&text=Message”
already ,I have been set the AND <CHAT_ID>
I’m wondering if there is need to upgrade the OS.
I tried to execute the script in the terminal I got this error
failure: invalid URL protocol
can you help me please
correct syntax is
/tool fetch url="https://api.telegram.org/bot<TOKEN>/sendMessage\3Fchat_id=<CHAT ID or @channelusername>&text=<MESSAGE (max 4096 chrs)>"
But you can use only space, numbers and upper and lowercase latin letters, no special chars or signs.
! " $ ’ ( ) * , - .
0 1 2 3 4 5 6 7 8 9 ; < = >
A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~
The list can have errors.
You must urlencode first the text if is not standard or you must use reserved chrs like &, #, etc.
For example if the message must be Привіт must be equal to %D0%9F%D1%80%D0%B8%D0%B2%D1%96%D1%82
I tried that doesn’t work
and I can’t see any thing in the log that means the script isn’t working
Post full script
I tried All of them
/tool fetch url=“https://api.telegram.org/bot5801257/sendMessage?
chat_id=10559&text=%20%22Donload%20is%20more%20than%202M” keep-result=no;
/tool fetch url=“https://api.telegram.org/bot5801257/sendMessage?
chat_id=1055&text=%20%22Donload%20is%20more%20than%202M”
/tool fetch url=“https://api.telegram.org/bot5801257/sendMessage?
chat_id=1055&text=Download speed is more than 25MB”
/tool fetch url=“https://api.telegram.org/bot5801257/sendMessage\
chat_id=-1055&text=Download speed is more than 25MB”
I hope you post false bot and chatid…
What error you give?
For me, with your URL is:
failure: closing connection: <401 Unauthorized> 149.154.167.220:443 (4)
sure, I posted false bot and chatID.
actually seems not working I can’t see any thing in the log
after I pasted the script in the terminal I got this line below:
expected end of command (line 1 column 105)
Regardless if work or not,
you have read my previous post???
Try this, without touch anything except set correct token and chat id:
/tool fetch url="https://api.telegram.org/bot<TOKEN>/sendMessage\3Fchat_id=<CHAT-ID>&text=test+message"