vysheng / tg

telegram-cli
GNU General Public License v2.0
6.48k stars 1.53k forks source link

Use telegram from script #1490

Open fedeb95 opened 6 years ago

fedeb95 commented 6 years ago

I didn't find anything in the documentation, so if it's not possible this is a feature request. Is it possible to send messages from a script, something like this:

telegram-cli --send-message <user> <message>

Also access other functionalitis this way. Thanks

sonfrau commented 6 years ago

Of course,

Try this:

!/bin/bash

msg_id="Test message" /bin/sh -c '[path where you have installed Telegram-cli]/telegram-cli -W -e "msg [chat_room you want to use] "$msg_ig'

ToMas-hack commented 6 years ago

Can Telegram-cli be used to add me with a script to channels to the invitations that my friends send me on Telegram?

fedeb95 commented 6 years ago

@sonfrau thank you! Is there a place I missed that explains all the functionalities accessible this way? I'd also like, for example, to retrieve all messages sent to me and store them in a file. Is that possible?