When you login by your phone number, you can set password for that phone number using telegram cli command set_password <hint>. After pressing enter it will ask for new password:, Also after entering pass and press enter it will ask for retype new password: and after filling that password will set.  
Overview:
$ Execute ./telegram-cli for specific profile
....//Initializing  
>set_password hint
new password: xxx
retype new password: xxx
>quit
$
Now I want to write a bash script to do the job but the problem is prompts. I tried something like below with no success:
#!/bin sh
./telegram-cli command for specific profile << EOF
set_password hint
#What do I have to do to enter password after prompt?  
As you know because I am in telegram cli command mode there is no commands like  sleep, read or something else.
Tell me if more information needed.
Thanks in advance