Telegram
إشعار تيليجرام عند خروج مستخدم الهوتسبوت (On-Logout) — 7
ضعه في خانة On Logout ببروفايل مستخدمي الهوتسبوت. عند كل خروج يرسل رسالة تيليجرام فيها اسم الكرت وعنوان IP وسبب انتهاء الجلسة.
RouterOS 7
# EN: Telegram bot token from @BotFather | AR: توكن البوت من @BotFather
:local botToken "change here";
# EN: Telegram chat ID that receives the alerts | AR: رقم الشات الذي سيستقبل التنبيهات
:local chatId "change here";
# EN: Runs only after the two variables are edited | AR: لا يعمل إلا بعد تعديل المتغيرين
:if ($botToken != "change here" && $chatId != "change here") do={
# EN: $user, $address and $cause are provided by the hotspot at logout | AR: المتغيرات $user و $address و $cause يوفرها الهوتسبوت عند الخروج
:local nl "%0A";
:local text ("LOGOUT" . $nl . "Voucher:+" . $user . $nl . "IP:+" . $address . $nl . "Reason:+" . $cause);
/tool fetch url=("<https://api.telegram.org/bot>" . $botToken . "/sendMessage?chat_id=" . $chatId . "&text=" . $text) keep-result=no;
}