The magic packet is sent on the data link layer (layer 2 in the OSI model) and when sent, is broadcast to all attached devices on a given network, using the network broadcast address; the IP-address (layer 3 in the OSI model) is not used.
#!/bin/bash
# Send to this user
CHATID=$1
# BotID
KEY="здесь_bot_key"
# Timeout
TIME="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
TEXT=$2
curl --proxy socks5://proxyuser:proxypasswd@proxyaddress:proxyport --silent --max-time $TIME --data "chat_id=$CHATID&disable_web_page_preview=1&text=$TEXT" $URL >/dev/null