Cli telegram in linux

Cli telegram in linux

NAME

telegram-cli - Command-line interface for Telegram messenger

SYNOPSIS

DESCRIPTION

Telegram messenger is a cloud-based instant messaging designed for smart phones and similar to Whatsapp but more flexible, and powerful. You can send messages, photos, videos and documents to people who are in your phone contacts (and have Telegram). Telegram also supports secret chats whose provide a private (encrypted) way of communication. . This package contains a command-line based client for Telegram with the following features: * Colored terminal messages. * Message management: history, stats, etc. * Group chat: create and manage groups. * Secret chat: secured and encrypted conversations. * Contact management: add/edit/remove contacts. * Multimedia support: send/load photos and videos.

OPTIONS

Telegram-cli Usage -u specify username (would not be asked during authorization) -k specify location of public key (possible multiple entries) -v increase verbosity (0-ERROR 1-WARNIN 2-NOTICE 3+-DEBUG-levels) -N message num mode -c config file name -p use specified profile -l log level -f during authorization fetch all messages since registration -E diable auto accept of encrypted chats -s lua script file -W send dialog_list query and wait for answer before reading input -C disable color output -R disable readline -d daemon mode -L log file name -U change uid after start -G change gid after start -D disable output -P port to listen for input commands -S unix socket to create

SEE ALSO

BUGS

AUTHOR

Источник

How To Use Telegram from the Command Line

telegram logo

All weekend I’ve been itching to write about telegram-cli, a command-line interface to the Telegram messaging service.

It’s something I’m keen to write about because the Wi-Fi in the coffee shop I regularly visit is a bit… Well, it’s a big like coffee shop Wi-Fi!

I rely on a ropey 4G tether (complete with 750MB data cap) which means data-nimble tools help me stay connected, even when the connection isn’t great.

Telegram – What Is It?

Telegram is a sort of open, secure messaging service that runs in the cloud. Think of it like WhatsApp meets Slack.

Читайте также:  How to make iso file linux

The service has a robust open API and puts a lot of emphasis on privacy, and offers a slate of mobile, web and desktop clients. These factors have helped to make the service incredibly popular with open-source, privacy and Linux enthusiasts in particular.

Telegram lets you send regular text messages, photos, videos and other files to other Telegram users, as well as initiate so-called ‘secret chats’ which are encrypted.

For the avoidance of doubt please note that I am not writing this post to persuade anyone that Telegram is ‘the best’ messaging service around. Nor am I going to say that it is the most secure, or that using it through a Terminal app makes any sense when various mobile and desktop GUI apps are freely available.

Nope, I’m just here to highlight an alternative way to use something that you may already use. If you find it helpful, fantastic. If you don’t, no worries.

Telegram CLI Features

Like fully-fledged GUI clients, Telegram-cli lets you send, receive and read messages to/from your contacts, channels and groups.

It offers the following features:

  • Colored terminal messages
  • Message management, including message history
  • Create/join/manage group chats
  • Start secure encrypted one-on-one conversations
  • Add/edit/remove contacts
  • Send/load photos and videos

Telegram-CLI rather helpfully supports tab completion. If you’re the sort of person who regularly forget commands, or simple like to speed up your workflow, you only need to remember the first few characters of any command, and the tab key will do the rest.

Features that aren’t supported in telegram-cli include stickers, emoji, custom backgrounds, voice messages, and other visual fluff.

How To Install Telegram CLI on Ubuntu

screen-shot-2016-10-23-at-18-57-20

If you’re running Ubuntu 16.04 LTS or later can install telegram-cli through the Snap store by searching for ‘telegram-cli’ in the Ubuntu Software app or running:

sudo snap install telegram-cli

Logging In

Like WhatsApp, Telegram is a service centred around your mobile number as your identity. You’ll need to have already signed up to Telegram from a mobile app before you can “log in” and use the service through the Terminal.

Assuming you have, just run the app using the following command:

Читайте также:  Расширенное администрирование ос astra linux special edition alse 1603

This will prompt you for your phone number. Type it in to the terminal, then double-check that it’s correct. Press Enter.

A code will be sent to your mobile device. You simply need to enter this code into the Terminal when prompted to do so to authenticate.

After that, you’re good to go!

Using Telegram-CLI

screen-shot-2016-10-23-at-18-53-49

Telegram works on the basis of “peers” rather than phone numbers. To see a list of people in your contacts list who you can message, type:

To view a list of all current chats, groups and unread messages type:

To message a contact or group, type msg followed by their name (remember that you can use tab to autocomplete) and then your message:

To view a conversation or chat history type history followed by the name of the contact or group and the number of lines you wish to see:

E.g.: history Liam 10 will print the 10 most recent messages in my conversation with Liam:

screen-shot-2016-10-23-at-18-46-29

You’ll find a comprehensive list of all the commands supported by telegram-cli on the project’s GitHub wiki:

Or, while using the client, by running help .

Home / News / How To Use Telegram from the Command Line

Источник

Установка telegrtam-cli в Ubuntu и Debian

Теперь можно перейти в каталог и приступить к сборке:

А вот перед make мы рекомендуем открыть файл ./tgl/mtproto-utils.c и закомментировать или удалить там строки 101 и 115:

assert (0); // As long as nobody ever uses this code, assume it is broken.

В противном случае велик риск получить ошибку вот такого вида:

tgl/mtproto-utils.c:101: BN2ull: Assertion 0′ failed. SIGNAL received

И теперь самое долгое, вызываем команду ниже и идём заваривать чай

Если всё удачно прошло(если нет, копируйте красную ошибку, вставляйте в гугл и читайте с чем это связано, в данном примере представлена Ubuntu и Debian), то запускаем:

tg/bin/telegram-cli -k tg/tg-server.pub -W

Вас попросят войти и ТАДАМ!

Поздравляем. Теперь вы можете использовать консольный клиент телеграмма, но перед этим ознакомьтесь с командами.

Команды

msg Text — отправить сообщение пиру

fwd — переслать сообщение пользователю. Вы можете видеть номера сообщений, запуская клиент с опцией -N

chat_with_peer — начать переписку с этим пиром. /exit или /quit для завершения этого режима.

Читайте также:  Adobe illustrator аналог linux

add_contact — попытаться добавить контакт в список контактов по номеру телефона

rename_contact — попытаться переименовать контакт. Если у вас есть несколько устройств, то будет битва

mark_read — отметить прочитанными все сообщения от пира

delete_msg — удалить сообщение (но не полностью)

restore_msg — восстановить удалённое сообщение. Невозможно для серкретного чата. Возможно только некоторое время спустя (один час, я думаю) после удаления

Мультимедия

send_photo — отправить фото

send_video — отправить видео

send_text — отправить содержимое файла текстом

load_photo/load_video/load_video_thumb/load_audio/load_document/load_document_thumb — загрузить фото/видео/аудио/документ в директорию загрузок

view_photo/view_video/view_video_thumb/view_audio/view_document/view_document_thumb — загрузить фото/видео в папку загрузок и открыть стандартным просмоторщиком

fwd_media послать медиа файл в сообщении. Используйте это, чтобы скрыть информацию об авторе медиа файла (хотя всё ещё будет возможно найтиuser_id из самого медиа файла, но невозможно получить access_hash этого пользователя)

set_profile_photo — установить фотографию профиля. Обрезается до квадрата

Групповые чаты

chat_info — вывести информацию о чате

chat_add_user — добавить пользователя в чат

chat_del_user — удалить пользователя из чата

create_group_chat … — создать групповой чат с пользователями, используйте chat_add_user чтобы добавить больше пользователей

chat_set_photo — поставить фото на чат. Обрезается до квадрата

search pattern — поиск pattern в сообщениях с пиром

global_search pattern — поиск pattern во всех сообщениях

Секретный чат

create_secret_chat — создать секретный чат с пользователем

visualize_key — вывести визуализацию ключа шифрования. Вы должны сравнить его с ключем вашего собеседника

set_ttl — установить ttl в секретном чате. Не смотря на то, что клиент игнорирует это, вашему собеседнику это может быть полезно

accept_secret_chat — вручную принять секретный чат (действенно только если клиент запущен с ключём -E)

Статистика и информация

user_info — вывести информацию о пользователе

history [limit] — вывести историю (и пометить прочитаными). Лимит по умолчанию = 40

dialog_list — вывести информацию о диалогах

contact_list — вывести информацию о пользователях в вашем списке контактов

suggested_contacts — вывести информацию о пользователях с которыми у вас много общих друзей

show_license — показать лицензию(GPLv2)

get_self — получить инфорцию о своем пользователе

export_card — вывести ваше ‘карточку’ которую каждый позже может импортировать себе в контакты

import_card — получить пользователя по карточке. После этого вы сможете писать ему сообщения

safe_quit — подождать завершения всех запросов и выйти

Источник

Оцените статью
Adblock
detector