Skip to content

Latest commit

 

History

History
48 lines (22 loc) · 1.33 KB

README.md

File metadata and controls

48 lines (22 loc) · 1.33 KB

telegram_sh (old version, see dev branch instead)

This is deep re-writed version of old script:

  1. more commands, to configurate bot, send messages or/and documents

  2. writed to work in shell, so can take arguments from output of other shell commands

  3. or can be imported as python module

  4. help (-h/--help) for each command and globally and in python help function

How to setup tgsend

  1. git clone

  2. make sure that you have requests lib installed globally, or modify shebang

  3. chmod +x tgsend.py

  4. add link to file in your bin folde

  5. get api-key from BotFather

  6. tgsend create -A api-key

  7. send any message to bot (to create chat)

  8. get chat id using tgsend getid, store it in your environment (contacts file editor will be added, probably soon)

Usage:

tgsend send [-h] [-A <API-key>] (-T <chat id> | -t <chat name>) [-m message [message ...]] [-d file [file ...]] [-a audiofile [audiofile ...]

Or:

from tgsend import message_handler

message_handler(api_key = <API-key>, chat_id = <chat id>, messages = ["message", "message])

Screenshot 2023-03-30 05 05 22

Screenshot 2023-03-30 05 06 28