Script ini berfungsi untuk mengirimkan informasi penggunaan internet di Simple Queue Mikrotik ke Bot Telegram.

:local download;
:local upload;
:local bot "BOT ID";
:local chat "CHAT ID";
:local tanggal "Tanggal: $[/system clock get date] %0A";
:foreach queue in=[/queue simple find parent="CLIENT HOTSPOT"] do={
:local name ("Nama ".[/queue simple get value-name="name" $queue]."%0A")
:local byte ("Pemakaian ".[/queue simple get value-name="byte" $queue]." Bytes %0A")
:local trafik ("Trafik ".[/queue simple get value-name="rate" $queue]." %0A")
:local limit ("Limit ".[/queue simple get value-name="max-limit" $queue]." %0A")
:set download ($name.$byte.$trafik.$limit)
/tool fetch url="https://api.telegram.org/bot$bot/sendmessage\?chat_id=$chat&text=Pemakaian internet: %0A$tanggal$download" keep-result=no;
}

Leave a Reply