0% found this document useful (0 votes)
2K views1 page

Script Bot Telegram

The document contains code to send status update messages to a Telegram chat. There are sections for when a host is up or down. It defines variables for the chat ID, bot ID, status message, and API call to send the message. When the host is up, it will send a message with the current date/time and status that the router is on. When the host is down, it will send a message with the date/time and status that the router is off.

Uploaded by

Syaifudin Latif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views1 page

Script Bot Telegram

The document contains code to send status update messages to a Telegram chat. There are sections for when a host is up or down. It defines variables for the chat ID, bot ID, status message, and API call to send the message. When the host is up, it will send a message with the current date/time and status that the router is on. When the host is down, it will send a message with the date/time and status that the router is off.

Uploaded by

Syaifudin Latif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Up

====
:local CHID "578255384";
:local BotID "959660770:AAFbgeV12Zqt-ZrB3vbCmLXUZuMCFuXgezc";
:local HostStatus "Koneksi Server Anda Sudah Kembali Normal";

:local message "Ping $host $HostStatus";


/tool fetch url="[Link]
chat_id=$CHID&text=$message";
====
Down
====
:local CHID "578255384";
:local BotID "959660770:AAFbgeV12Zqt-ZrB3vbCmLXUZuMCFuXgezc";
:local HostStatus "Koneksi Server Anda Sedang Down";

:local message "Ping $host $HostStatus";


/tool fetch url="[Link]
chat_id=$CHID&text=$message";
=====
-------------------------------------------
Up
==============
:local hh $host
:local bot "904712554:AXXX"
:local chat "59XXX"
:local datetime "Tanggal: $[/system clock get date] %0A Jam: $[/system clock get
time]"
/tool fetch url="[Link]
chat_id=$chat&text=$datetime %0ARouter: $hh ON \E2\9C\85" keep-result=no
==============
Down
==============
:local hh $host
:local bot "904712554:AAXXXX"
:local chat "550XX"
:local datetime "Tanggal: $[/system clock get date] %0A Jam: $[/system clock get
time]"
/tool fetch url="[Link]
chat_id=$chat&text=$datetime %0ARouter: $com $hh OFF \E2\9D\8C " keep-result=no

You might also like