Mikrotik To Discord
As the name, this scripts can send message from your Mikrotik such as Hotspot login, Netwatch and some others who supported Mikrotik Scripts. I made this script because i have to know the user and some my devices are managed by my mikrotik to send the log into my discord server, before that i'm using TelegramBot to send it but i'm not very active using telegram, so i decided to make this script.
This script are very simple, mostly using curl for fetching by method GET the Discord API Webhook.
All you need to know i'm just providing the tutorial, you can use my scripts who already hosted by Heroku or you can host the script wherever you want
# Source Code
https://github.com/troke12/MikrotikToDiscord (sorry it's full Indonesian, you can easily click Heroku button if you wanna deploy by your own)
# Requirements
- Discord Server
- Discord Webhook (use this tutorial)
- Mikrotik
# Tutorial
1. Copy these code into your mikrotik
Code: Select all
/tool fetch url="https://trokewebhook.herokuapp.com/form.php?text=INPUT_YOUR_TEXT&id=INPUT_ID_WEBHOOK&token=INPUT_TOKEN_WEBHOOK" keep-result=no;
- URL - This is my script that already hosted by Heroku, you can change this if you hosted somewhere else
- INPUT_YOUR_TEXT - You can put anything in here for example "MY+DEVICE+ARE+DOWN"
- INPUT_ID_WEBHOOK - Copy your webhook id here
- INPUT_TOKEN_WEBHOOK - Copy your token here
Webhook URL Explaination :
After you creating the webhook discord you will have the url for the webhook, please note that do not share your webhook url to anyone
Code: Select all
https://discord.com/api/webhooks/{{ID_WEBHOOK}}/{{TOKEN_WEBHOOK}}
Example :
*My Webhook url already deleted
2. Results
I hope you like it guys! thanks!