vysheng / tg

telegram-cli
GNU General Public License v2.0
6.37k stars 1.51k forks source link

Bash Scripting #1225

Open davelister69 opened 7 years ago

davelister69 commented 7 years ago

I am attempting to script the automation of messages.

I am trying to do this using the --exec switch.

If I enter a single command (contact_list) that command is successfully executed. However if I pass more than one command, nothing happens.

bin/telegram-cli -k tg-server.pub --exec contact_list

functions as expected.

bin/telegram-cli -k tg-server.pub --exec contact_list; msg username1 testmsg

or

bin/telegram-cli -k tg-server.pub --exec contact_list && msg username1 testmsg

do not function.

Is this possible?

Is there an easier way to do this?

bebehack3r commented 7 years ago

You have to run it with -W argument, so your contact list will load automatically and there will be no need in first command.

ghost commented 7 years ago

@sashaledockol can you provide an example, please? :) or @davelister69 , did you find out how to do it?