Skip to content

Instantly share code, notes, and snippets.

@huezo
Last active May 9, 2020 02:43
Show Gist options
  • Save huezo/593e37e41dca7c8a09da58d0fc315c30 to your computer and use it in GitHub Desktop.
Save huezo/593e37e41dca7c8a09da58d0fc315c30 to your computer and use it in GitHub Desktop.
enviar-tg.bash
#!/bin/bash
#
# By: @huezohuezo1990
# http://t.me/huezohuezo1990
# https://huezohuezo1990.wordpress.com/
#
# GPLv3+
#
#Manual:
#sudo chmod +x enviar-tg.bash
#bash enviar-tg.bash MENSAJE
#Nota Instalar CURL
#sudo apt install curl -y
#Instalar CURL
MENSAJE=$1
#TOKEN del Bot
TOKEN=""
#ID del Grupo o Canal etc.
ID=""
#$MENSAJE="Hola Mundo!"
URL="https://api.telegram.org/bot$TOKEN/sendMessage"
# Para Saber el ID del Grupo
URL_ID="https://api.telegram.org/bot$TOKEN/getUpdates"
echo ""
echo "Para Saber el ID del Grupo"
echo ""
curl -s -X POST $URL_ID
# Enviar Mensaje
echo "enviando..."
echo ""
echo ""
curl -s -X POST $URL -d chat_id=$ID -d text="$MENSAJE"
#curl -s -X POST $URL -d chat_id=$ID -d text="$MENSAJE"
#Manual:
#sudo chmod +x enviar-tg.bash
#bash enviar-tg.bash MENSAJE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment