ORNever mind, just noticed this:
Changes in v6.39rc7:
*) Fixed - Tool fetch didn't work with notification - execute on server
Upgrading now
:execute {/tool fetch url="https://api.telegram.org/botXXXXXX:AsG7sapGXDS1aHi_RllzgU9oJUm2wyKyHVw/sendMessage\?chat_id=1231231&text=[TimeAndDate] Service [Probe.Name] on [Device.Name] ([Device.CustomField1] - [Device.CustomField2]) is now [Service.Status] ([Service.ProblemDescription])" keep-result=no}
/tool fetch url="https://api.telegram.org/botXXXXXXX:AAFZJtaHT_of7tV9IPEyK9R9XXXXFtk9_Ap-Pvk/sendMessage\?chat_id=XXXXXX&text=[TimeAndDate] Nodo: [Device.Name], Status: [Service.Status]" keep-result=no
after creating the bot you can write to him. from browser you can see the id of this chat (you can use https://api.telegram.org/botXXXXXXXXXXX ... getUpdates )Hi,
what should be the chat_id= ??
thanks
yes you can. +37544five44340fivethank you verymuch... its work. I would like to ask another question, is possible to do this on viber also ?
Thanks.
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
or viber...What do you think of adapting the dude to send messages through Whatsapp it is much more popular than the telegran.
You can do the same with Viber. Use a Viber "Public Account". I haven't tried yet as it's only available for selected countries.or viber...
Hi,
I've tested the hyperlink, that it's inside the fetch command:
But It doesn't even send the Hello message to the group the bot is participating.Code: Select allhttps://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
The webpage says: "{"ok":false,"error_code":404,"description":"Not Found: method not found"}"
In Mikrotik terminal, it says: failure: closing connection: <400 Bad Request> 149.154.167.200:443 (4)
Am I doing something wrong? Do I need any additional step to allow the bot start a message?
Thanks!
/tool fetch url="https://api.telegram.org/botxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendmessage?chat_id=xxxxxx&text=Hi" keep-result=no
/tool fetch url="https://api.telegram.org/bot<tokenbot>?chat_id=-1001099321185&text=[RECOVER] [TimeAndDate]; [Device.Name]: [Device.FirstAddress]; Status: [Service.Status] ([Service.ProblemDescription])" keep-result=no
Hi,
I've tested the hyperlink, that it's inside the fetch command:
But It doesn't even send the Hello message to the group the bot is participating.Code: Select allhttps://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
The webpage says: "{"ok":false,"error_code":404,"description":"Not Found: method not found"}"
In Mikrotik terminal, it says: failure: closing connection: <400 Bad Request> 149.154.167.200:443 (4)
Am I doing something wrong? Do I need any additional step to allow the bot start a message?
Thanks!
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
https://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=-123456789&text=Hello
remove \ from "sendMessage\?chat_id="The issue was fixed, adding a minus sign before the chat ID:
before:
after:Code: Select allhttps://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=123456789&text=Hello
Code: Select allhttps://api.telegram.org/bot123456789:AAQFb1byb3LEwMes_TQeCM1k5wsFb_VguhG/sendMessage\?chat_id=-123456789&text=Hello
I tried this with RouterOS and I receive the messages on telegram, but not the time, device name and status, maybe because in RouterOS its difrent from Dude, is there any chance to get this working also on RouterOS?I configured all and is working!!!
Correct code for Version 6.38.1 - Please update de wiki
Code: Select all/tool fetch url="https://api.telegram.org/botXXXXXXX:AAFZJtaHT_of7tV9IPEyK9R9XXXXFtk9_Ap-Pvk/sendMessage\?chat_id=XXXXXX&text=[TimeAndDate] Nodo: [Device.Name], Status: [Service.Status]" keep-result=no
Gretting
Pablo
Sorry for my bad English
I have automated backups and also like the option to send send via telegram, automated or via command in telegram.hi
how to send file ( backup file ) via Telegram ?
Yes.. you can use it at netwatchThat script will work with NetWacht?
[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<TOKEN_BOT>\?chat_id=348399094&text=HelloWorld!" keep-result=no
status: failed
failure: closing connection: <502 Bad Gateway> 149.154.167.200:443 (4)
it looks like you had made a mistake in token)I have followed the instructions but it doesn´t work. To see what´s happening i tried the fetch command on the command line but i always receive the following error:
Any ideas ???Code: Select all[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<TOKEN_BOT>\?chat_id=348399094&text=HelloWorld!" keep-result=no status: failed failure: closing connection: <502 Bad Gateway> 149.154.167.200:443 (4)
the command to send is:I have followed the instructions but it doesn´t work. To see what´s happening i tried the fetch command on the command line but i always receive the following error:
Any ideas ???Code: Select all[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<TOKEN_BOT>\?chat_id=348399094&text=HelloWorld!" keep-result=no status: failed failure: closing connection: <502 Bad Gateway> 149.154.167.200:443 (4)
Sorry man, i didn´t write it right on the last post, but that´s exactly what i typed... I was calling token the entire <BOT_ID>:<BOT_TOKEN> ... my mistake. I created the bot using botfather and followed the tutorial, i still got the 502 bad gateway error.the command to send is:
/tool fetch url="https://api.telegram.org/botXXXXX:YYYYY ... text=Hello World" keep-result=no
where XXXXX is your bot id
YYYYY bot token
ZZZZZ chat id
/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>\?chat_id=348399094&text=Hello World !" keep-result=no
first of all:Sorry man, i didn´t write it right on the last post, but that´s exactly what i typed... I was calling token the entire <BOT_ID>:<BOT_TOKEN> ... my mistake. I created the bot using botfather and followed the tutorial, i still got the 502 bad gateway error.the command to send is:
/tool fetch url="https://api.telegram.org/botXXXXX:YYYYY ... text=Hello World" keep-result=no
where XXXXX is your bot id
YYYYY bot token
ZZZZZ chat id
What am i doing wrong ?Code: Select all/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>\?chat_id=348399094&text=Hello World !" keep-result=no
So the line should look like this ?first of all:
/sendMessage? before chat_id
the second is, that you can use it in script (create test scrip with only command to send message), because from command line on mikrotik it wouldn't work
/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>/sendMessage?=Hello World\?chat_id=348399094" keep-result=no
no, as i had posted:So the line should look like this ?first of all:
/sendMessage? before chat_id
the second is, that you can use it in script (create test scrip with only command to send message), because from command line on mikrotik it wouldn't work
Code: Select all/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>/sendMessage?=Hello World\?chat_id=348399094" keep-result=no
Well, i tried as you said and now i receive a 404 not found error message. Now i´m posting my bot ID and TOKEN.So the line should look like this ?first of all:
/sendMessage? before chat_id
the second is, that you can use it in script (create test scrip with only command to send message), because from command line on mikrotik it wouldn't work
Code: Select all/tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN>/sendMessage?=Hello World\?chat_id=348399094" keep-result=no
no, as i had posted:
/tool fetch url="https://api.telegram.org/botXXXXX:YYYYY/sendMessage?chat_id=ZZZZZ&text=Hello World" keep-result=no
[admin@Dude_x86] > /tool fetch url="https://api.telegram.org/bot<BOT_ID>:<BOT_TOKEN=Hello World" keep-result=no
status: failed
failure: closing connection: <404 Not Found> 149.154.167.198:443 (4)
{"ok":true,"result":{"id":BOT_ID,"is_bot":true,"first_name":"xxxx","username":"xxxxxxx"}}
Please, write there if you get message in telegram.
What am i missing here ?
Shadeofspirit, i receive your message. Thanks for the help man, i´ll try it on a script as you said.Please, write there if you get message in telegram.
What am i missing here ?
If you get - all is correct in your config.
read my previous message - this command can be used in script, but not in command line
if you want, i can send you script that i used for sending message by skype, telegram, viber, e-mail
Shadeofspirit, i receive your message. Thanks for the help man, i´ll try it on a script as you said.
Yes, could you send me please ? you can post it here on the forum or by gmail if you preferif you want, i can send you script that i used for sending message by skype, telegram, viber, e-mail
Shadeofspirit, i receive your message. Thanks for the help man, i´ll try it on a script as you said.
and i suggest you to delete your message on forum with your bot token
did you select this type of notification for this device?Hi hi, team.
I'm stuck on same problem, or similar to this one.
When i test dude notification all working ok, but when some switch in dude lost , the chat bot is silent.
And i dont know where can be the mistake, because all is working but bot in the chat sleeping
Any information needed ?
so, if you had created it notifications for all status changing you want(for example with name "telegram"), than, if you want to have it for all devices. go to settings-polling. make sure that "enabled" is marked and that in the list of notifications there is mark near "telegram"/tool fetch url="https://api.telegram.org/botxxxxxxxxx:y ... 1212&text=[Probe.Name] on [Device.Name] now [Service.Status] ([Service.ProblemDescription])"
It work's when i try test, it send's message in chat, but when swich drop nothing happens
I tested with 6.44.3 (cannot use other version because incompatible of any devices) and dont work!! Help!!!I had the same problem in my dude server (6.43.. The fetch tool didn't works when i pressed the "test" button, but you need to execute that command on a terminal in your dude's winbox to see a result or another possible ideas. The link must be in quotes! Don't forget that!
/tool fetch url="https://api.telegram.org/botXXXXX/sendM ... xt=HiThere"
text=Time:%20[Time];%20Device:%20[Device.FirstAddress];%20Status:%20[Service.Status]"
Try thisHello everyone, the code is actually working in RouterOS 6.43.16; but if you want to add a biggest message, you'll need to add %20 instead of a space; so please update the Wiki.
New code from text:
text=Time:%20[Time];%20Device:%20[Device.FirstAddress];%20Status:%20[Service.Status]"
&text=🖥 Device: [Device.FirstAddress] - <b>[Device.Name]</b>;%0A⏰ Time: [Time];%0Aℹ Status: <b>[Service.Status]</b>&parse_mode=HTML" keep-result=no
Hello!! im using the same version! can you share the command you are using in notifications?Hello everyone, the code is actually working in RouterOS 6.43.16; but if you want to add a biggest message, you'll need to add %20 instead of a space; so please update the Wiki.
New code from text:
text=Time:%20[Time];%20Device:%20[Device.FirstAddress];%20Status:%20[Service.Status]"
/tool fetch mode=https url="https://api.telegram.org/bottokenHTTPAPIreceived/sendMessage\?chat_id=-idreceived&text=TEST" keep-result=no
/tool fetch mode=https url="https://api.telegram.org/bottokenHTTPAPIreceived/sendMessage?chat_id=-idreceived&text=TEST" keep-result=no
/tool fetch url="https://api.telegram.org/bot123456789:ABCD1efghiL2mnouPqRsT3uvZAB_4CdEFgh/sendMessage?chat_id=-123456789&text=asdasdasd&parse_mode=HTML" keep-result=no
*bold text*
_italic text_
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
`inline fixed-width code`
```
pre-formatted fixed-width code block
```
```python
pre-formatted fixed-width code block written in the Python programming language
```
/tool fetch url="https://api.telegram.org/bot < BOT-TOKEN > /sendMessage?chat_id= < CHAT-ID > &text=🔴%20%20[Device.Name]%20%20🔴%0A*IP:*%20[Device.FirstAddress]%0A*MAC:*%20[Device.MacAddressesCommaList]%0A*STATUS:*%20[Device.Status]%0A&parse_mode=markdown" keep-result=no