Telegram бот для постинга записей в каналы, где бот находится или в личку.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin fcd61290ae fix 1 month ago
helpers import 1 year ago
Dockerfile use proxy 1 month ago
bot.py use proxy 1 month ago
docker-compose.yml use proxy 1 month ago
readme.md fix 1 month ago
requirements.txt use proxy 1 month ago
run use proxy 1 month ago
send_test_message.sh use proxy 1 month ago
telegram-post-bot.service import 1 year ago

readme.md

Telegram-post-bot

This is my Telegram bot that can accept messages in JSON from port or socket file and forward to group, channel or private person.

Register new bot and get token with @BotFather bot or may be you already did it.

Deploy as old man

Best results if you run it in Docker container, but if you want some sex...

>$ python3 -m venv telegram-post-bot
>$ source telegram-post-bot/bin/activate
>$ pip install --no-cache-dir -r requirements.txt

Now change path in telegram-post-bot.service to actual and install it to systemd.

Deploy in Docker

Start your new container:

docker run -p 4521:4521 -e BOT_TOKEN="some token" \
    -e BOT_PROXY=socks5://192.168.1.9:9050 \
    -e SENTRY_DSN=https://token@sentry.io/1253400 \
    iam21h/telegram-post-bot

Remove proxy and\or Sentry if you dont need it.

Now test it:

>$ ./send_test_message.sh 20823278 "test title" "message body"
[{"state": "ok", "result": {"chatID": "20823278", "message": "test title\n\nmessage body"}}]

change 20823278 to your chat ID.

Sample alert script for Zabbix here https://blindage.org/?p=9548