User Tools

Site Tools


сервис_telegram

This is an old revision of the document!


Сервис Telegram

BotFather

/newbot

choose name: Val spec N

choose username: ValspecN_bot

...
You will find it at t.me/Valspec2bot
...
Use this token to access the HTTP API:
823268117438:AAE5W1PlK3ex0udwaQeznHG5ejsQNXc-J58
...
/start
...
https://api.telegram.org/bot823268117438:AAE5W1PlK3ex0udwaQeznHG5ejsQNXc-J58/getUpdates
...
        "chat": {
          "id": 1776721761
...


$ cat send-to-telegram.sh
#!/bin/sh

[ "$1" ] && MESSAGE=$1 || MESSAGE="Hello, world!"
 TOKEN="768604181156:AAGB1Qwvd-DAPhFbQiMKR3InggtIvPPEtT8"

CHAT_ID="1776721761"
curl -s -X POST https://api.telegram.org/bot$TOKEN/sendMessage -d chat_id=$CHAT_ID -d text="$MESSAGE"
$ time make buildworld; /home/val/send-to-telegram.sh FINISH
сервис_telegram.1756379938.txt.gz · Last modified: 2025/08/28 14:18 by val