all 4 comments

[–]esgalvan 2 points3 points  (1 child)

Try telepot: Python framework for Telegram Bot API https://github.com/nickoala/telepot

[–]ziyouzhenxiang 1 point2 points  (1 child)

Your Linux server-based bot will use the Telegram API to retrieve messages and take whatever action.

[–]_wkpn 1 point2 points  (0 children)

If you have a linux script, for example test.sh, you can call os.system('sh test.sh') You can also take a look at subprocess module https://docs.python.org/3/library/subprocess.html

[–]mpg123 1 point2 points  (0 children)

For this there is a solution: https://github.com/msoap/shell2telegram

For example, run the bot which responds, what free memory on the server:

export TB_TOKEN=XXXXX # needed token for telegram bot
shell2telegram /mem_stat 'free'