bot telegram user hotspot

Anda bisa membuat, menghapus, disable, enable dan merubah profile user hotspot mikrotik hanya dengan bantuan bot telegram cukup dengan menggunakan System Script dan System Scheduler pada mikrotik tanpa harus punya server PHP sendiri, ini cukup mudah dipasang dan digunakan bagi orang awam yang tidak paham pemograman PHP..

Agar script ini berjalan dengan semestinya anda harus membuat terlebih dahulu bot telegram interaktif yang terdapat pada postingan berikut ini: Monitoring Mikrotik dengan Bot Telegram Interaktif tanpa Pemograman PHP

Baca juga: Cek Kuota Voucher Hotspot dengan Bot Telegram

Perintah pada bot:

  • /hotspot add namaUser passwordUser -> Untuk membuat user hotspot dengan profil yang sudah ditentukan, sebelumnya ubah terlebih dahulu nama profil yang akan digunakan.
  • /hotspot delete namaUser -> Untuk hapus user hotspot
  • /hotspot disable namaUser -> Untuk men-disable user hotspot
  • /hotspot enable namaUser -> Untuk men-aktifkan user hotspot
  • /hotspot setprofil namaUser namaProfileBaru -> Untuk mengganti profil pada user hotspot
  • /hotspot pasword namaUser PasswordBaru -> Untuk mengganti pasword user hotspot
  • /hotspot print -> Untuk menampilkan detail user hotspot yang aktif
  • /hotspot user namaProfile -> Untuk menampilkan user hotspot berdasarkan nama profile

Buat Script dengan nama “tg_cmd_hotspot”

Share to Unlock Contentimage/svg+xml

Silahkan share untuk membuka link download dan membuka scriptnya

Apabila tutorial ini bermanfaat support saya dengan cara share artikel ini.. Terimakasih 

#Cara instal cari di labkom.co.id
:local send [:parse [/system script get tg_sendMessage source]]
:local param1 [:pick $params 0 [:find $params " "]]
:local param2 [:pick $params ([:find $params " "]+1) [:len $params]]
:local param3 [:pick [:pick $params ([:find $params " "]+1) [:len $params]] ([:find [:pick $params ([:find $params " "]+1) [:len $params]] " "]+1) [:len [:pick $params ([:find $params " "]+1) [:len $params]]]]
:if ([:len [:find $param2 " "]]>0) do={
	:set param2 [:pick [:pick $params ([:find $params " "]+1) [:len $params]] 0 [:find [:pick $params ([:find $params " "]+1) [:len $params]] " "]]
} else={
	:set param3 ""
}

:put $params
:put $param1
:put $param2
:put $param3
:put $chatid
:put $from

:if ($param1="add") do={
/ip hotspot user add name=$param2 password=$param3 profile=Mahasiswa 
$send chat=$chatid text=("Username: $param2 Password: $param3 Berhasil dibuat...") mode="Markdown"
}
:if ($param1="delete") do={
/ip hotspot user remove [find name=$param2]
$send chat=$chatid text=("User: $param2 Berhasil dihapus") mode="Markdown"
}
:if ($param1="disable") do={
/ip hotspot user disable [find name=$param2]
$send chat=$chatid text=("User: $param2 Berhasil di disable") mode="Markdown"
}
:if ($param1="enable") do={
/ip hotspot user enable [find name=$param2]
$send chat=$chatid text=("User: $param2 Berhasil di enable") mode="Markdown"
}
:if ($param1="setprofil") do={
/ip hotspot user set profile=$param3 [find name=$param2]
/ip hotspot active remove [find name=$param2]
$send chat=$chatid text=("User: $param2 Berhasil diganti profile menjadi $param3...") mode="Markdown"
}
:if ($param1="pasword") do={
/ip hotspot user set password=$param3 [find name=$param2]
/ip hotspot active remove [find name=$param2]
$send chat=$chatid text=("User: $param2 pasword diganti menjadi $param3...") mode="Markdown"
}
:if ($params="print") do={
:local output
:foreach activeIndex in=[/ip hotspot active find] do={
:local activeUser ("*Username:* ".[/ip hotspot active get value-name="user" $activeIndex]."%0A")
:local activeAddress ("*Address:* ".[/ip hotspot active get value-name="address" $activeIndex]."%0A")
:local activeMACAddr ("*MAC Address:* ".[/ip hotspot active get value-name="mac-address" $activeIndex]."%0A")
:local activeLoginBy ("*Login by:* ".[/ip hotspot active get value-name="login-by" $activeIndex]."%0A")
:local activeUptime ("*Uptime:* ".[/ip hotspot active get value-name="uptime" $activeIndex]."%0A")
:set output ($output.$activeUser.$activeAddress.$activeMACAddr.$activeUptime.$activeLoginBy."%0A")
}
$send chat=$chatid text=("$output") mode="Markdown"
}
:if ($param1="user") do={
:local output
:foreach activeIndex in=[/ip hotspot user find profile=$param2] do={
:local user ("*Username:* ".[/ip hotspot user get value-name="name" $activeIndex]."%0A")
:local password ("*Password:* ".[/ip hotspot user get value-name="password" $activeIndex]."%0A")
:local uptime ("*Uptime:* ".[/ip hotspot user get value-name="uptime" $activeIndex]."%0A")
:set output ($output.$user.$password.$uptime."%0A")
}
$send chat=$chatid text=("$output") mode="Markdown"
}

Menampilkan detail user hotspot yang sedang aktif active
Menampilkan user hotspot