Автор Тема: Telegram bot sender  (Прочитано 1189 раз)

Оффлайн Anton Shevtsov

  • Начинающий
  • *
  • Сообщений: 47
Telegram bot sender
« : 07.12.2017 13:16:47 »
Для своих личных системноадминистративных нужд, сделал отправлялщика сообщений в телеграм. От имени бота.
т.е. сидит бот в группе и шлет туда то что ему скажут.. умеет слать файлы и просто сообщения..

Собрал в rpm, только x64. Просьба потестить, кому интересно

Выглядит как-то так..


[user@hostl ~/Nextcloud/Code/tgsend]$ ./tgsend --help

TgSend v1.1
Send message/file from Bot. Use Telegram Bot API

Usage: /home/ADM72.LOCAL/shevtsovay/Nextcloud/Code/tgsend/tgsend [options]
option:
  -t --token         Bot token (*required)
  -i --chatId        Unique identifier for the target chat (*required)

  -m --message       Text of message (SendMessage method)
                OR
  -f --file          Path of sending file (SendDocument method)  -C --caption       Document caption (SendDocument method)

  -c --config        Configuration file path
                     search order:
                             ~/.tgsend/tgsend.conf
                             /etc/tgsend.conf
                             /usr/local/etc/tgsend.conf
                             /opt/tgsend/etc/tgsend.conf

  -d --debug         Debug on

  -p --proxy         Proxy IP
  -P --proxy-port    Proxy port (8080 default)

  -h --help          This help

Example:

Send 'hello world' text
tgSend -t '12345:AAABBBCCCDDDEEEEFFFF' --chatid='12345' -m 'hello world'

Send jpg file with debug
tgSend -t '12345:AAABBBCCCDDDEEEEFFFF' --chatid='12345' -f /tmp/lo.jpg -d

Оффлайн ruslandh

  • Поспешай не торопясь !
  • Модератор глобальный
  • *****
  • Сообщений: 32 246
  • Учиться .... Телепатами не рождаются, ими ....
    • Email
Re: Telegram bot sender
« Ответ #1 : 07.12.2017 13:44:07 »
Кстати :

https://t.me/ALTForum

;-)