send_to_telegram.sh

This script allows to send messages to Telegram users. Fo this, we need to know the botid for each potential addressee (can be collected using the @botid feature in Telegram (each addressee has to use this feature to identify its botid)).


#!/bin/bash
Pops=739396707
Ibu=920708810
Erwan=197340982
Afiqah=14823989
Mariam=16009939
HOME_ASSISTANT_BOT_TOKEN='796474109:AAF5vNaqBkDQh-d3RceIm-IORF8Dn3oDpBs'
POPSYANN_BOT_TOKEN='1222386124:AAHwfkrvDuw_IbX8lI9gfe0mxVMTukA8n44'
BUBUOAT_BOT_TOKEN='1192948035:AAGZAGDlBTS4FFmfsZt2XJ_GJu0IieDxJe8'
i=1
comment='test' 

while true
do
        for person in $Pops #$Ibu $Afiqah $Mariam $Erwan
        do
        curl -s -X POST https://api.telegram.org/bot$BUBUOAT_BOT_TOKEN/sendMessage \
        -F chat_id=$person -F text=$comment #"No $i. <i><strong>Go there to manage your projects: </strong></i>%0A<a href="TPMT">trd.mine.nu/TPMT/</a>" -F parse_mode=HTML
        i=$((i + 1))
        done
        sleep 100
done
exit
# to send a text in italic
#        -F chat_id=$person -F text="No $i. <i><strong>How many times are you going to receive this message before you come and beat me?</strong></i>" -F parse_mode=HTML 

# to send an URL
#       -F chat_id=$person -F text="No $i. <i><strong>Go there to manage your projects: <a href="TPMT">trd.mine.nu/TPMT/</a></strong></i>" -F parse_mode=HTML