Work in progress.
Usage: tg-cli [OPTIONS] --api-id <API_ID> --api-hash <API_HASH> <COMMAND>
Commands:
login Logs into the telegram account, saving session file
help Print this message or the help of the given subcommand(s)
Options:
-s, --session-file <SESSION_FILE> [default: .session]
--api-id <API_ID> [env: API_ID=12345678]
--api-hash <API_HASH> [env: API_HASH=abcde123456abcde]
-h, --help Print help
-V, --version Print version
Log in and save session. tg-cli
will ask for verification code and password, if 2-step verification is enabled.
Example:
$ export TGCLI_PASSWORD=mysuperpassword
$ tg-cli login --phone +79001234567
Put all dialog, their types (User/Group/Channel), ids and titles to stdout.
Example:
$ tg-cli list-dialogs
Listing 4 dialogs:
Group 1839823152 Old School Cruisers
Group 2223334444 Party makers
Channel 1234567899 Some interesting channel
User 111333 Telegram
Options:
--filter <FILTER>
- list only dialogs that containFILTER
in their titles (case insensitive). IfFILTER
starts with@
- dialogs with matching usernames will be shown
Send message message
to the dialog identifiedy by dialog
.
By default, dialog
is treated similar to --filter
option argument in list-dialogs command. If you want it to be treated as numeric id, you can use -n
(--numeric-id
) option.
Examples:
$ tg-cli msg @someone_special "Whats cooking, good looking?"
$ tg-cli msg -n 12345678 "hey there!"