Discord Notification

Hi everybody, i was testing some scripting on my 3011 and i got a discord notification webhook working and want to share with the rest

# Func: Discord send message
:local DiscordSendMessage do={
    /tool fetch url=($Token) http-method=post \
    http-data=("content=" . $Text) mode=https keep-result=no

}

# Constants
:local webhookUrl "<WebHook>";
:local DeviceName [/system identity get name];
:local MessageText "$DeviceName:\n";


# Check Update
:local MyVar [/system package update check-for-updates as-value];
:local Chan ($MyVar -> "channel");
:local InstVer ($MyVar -> "installed-version");
:local LatVer ($MyVar -> "latest-version");


:if ($InstVer = $LatVer) do={
    :set MessageText  ($MessageText . "System is already up to date");
} else={
    
    :set MessageText  "$MessageText\F0\9F\9F\A2 New version $LatVer is available! \n\F0\9F\94\B4 Installed version $InstVer, channel $Chan.";

    $DiscordSendMessage Token=$webhookUrl Text=$MessageText;
}

:log info $MessageText;

The code above checks for the latest routerOs update and sends a message to a discord webhook

Thank you for quoting the original author, and for being kind enough to point to the original post.
https://mhelp.pro/mikrotik-scripts-check-routeros-update/

Clearly we need plaegiarizing moderators !!!
There are only a few here worthy of that level of proficiency, and Im not one of them.

rextended what is a discord webhook ??