Giter VIP home page Giter VIP logo

telegramtui's Introduction

DEPRECATED

TelegramTUI

Telegram client on your console

telegram

Dependencies

Installation

pip install telegramtui

Proxy

You can set proxy in ~/.config/telegramtui/telegramtui.ini

Controls

  • Navigation: Tab, Shift+Tab, Mouse
  • Send message: Ctrl+S, Alt+Enter
  • Delete message: Ctrl+R
  • Send file: Ctrl+O
  • Exit: Ctrl+Q, ESC
  • Copy: Shift+Mouse
  • Paste: Shift+Ins, Shift+Middle mouse button

telegramtui's People

Contributors

ctrl-alt-deliberate avatar mrbesen avatar nasyxx avatar upsetbit avatar vtr0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telegramtui's Issues

Stickers doesn't appear as messages

Basically every sticker is a representation of a respective emoji.
So sending a sticker should be notified at least by showing such emoji.
Currently if you receive(or send via another client) a sticker no message appears.

libopenjp2.so.7 not found

Raspbian Stretch, got the above error after trying to run the program.
Needed to run sudo apt install libopenjp2-7 to fix

There's reason to believe this is an issue with pillow, but I am not experienced enough to be able to conclude

App crashes upon attempt to send an empty message

Reproduction:
Open any chat-box, dont't type anything, press "send" sequence.

Result:
/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py:1092: UserWarning: get_message_history is deprecated, use get_messages instead 'get_message_history is deprecated, use get_messages instead' Traceback (most recent call last): File "./telegramTUI", line 5, in <module> TelegeramTUI.run() File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run return npyssafewrapper.wrapper(self.__remove_argument_call_main) File "/opt/git/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper wrapper_no_fork(call_function) File "/opt/git/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork return_code = call_function(_SCREEN) File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main return self.main() File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 172, in main self._THISFORM.edit() File "/opt/git/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 47, in edit self.edit_loop() File "/opt/git/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop self._widgets__[self.editw].edit() File "/opt/git/TelegramTUI/src/npyscreen/wgboxwidget.py", line 164, in edit self.entry_widget.edit() File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 458, in edit self._edit_loop() File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 474, in _edit_loop self.get_and_use_key_press() File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 610, in get_and_use_key_press self.handle_input(ch) File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 92, in handle_input if self.parent_widget.handle_input(_input): File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 95, in handle_input if self.parent.handle_input(_input): File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 80, in handle_input self.handlers[_unctrl_input](_input) File "/opt/git/TelegramTUI/src/ui.py", line 88, in message_send client.message_send(message, current_user) File "/opt/git/TelegramTUI/src/telegramApi.py", line 127, in message_send data = self.client.send_message(self.dialogs[user_id].entity, message) File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 753, in send_message 'The message cannot be empty unless a file is provided' ValueError: The message cannot be empty unless a file is provided

Users with Emoji in their name breaks UI

I just started up TelegramTUI and noticed that users with emoji in their names will offset the borders in the user window and spill out into the main chat window.

Example:
Example

I've had a similar problem with another application I've helped develop. The problem there was that unicode emoji are multibyte characters, leading the drawing routines to miscalculate borders. To fix this, I switched to a curses based interface which uses windows. The worst case scenario in that case would be that the text would wrap around to the next line. So I suggest switching to curses and accounting for multibyte characters.

Adding new lines when not needed.

Screenshot_20190926-171213

The messages are sent and a new line is automatically added as you can see in the attached image. I have gotten another person using this to test as well and also produced a new line that is not really there.

Currently appears that where the "new line" was in the text entry for nice display is actually sent for the message even though I never added a new line for any reasons.

I will try get some real details about what triggers it but she t is usually around 30 words (more by chars than words) but I do believe that number will depend on how much space the application gets.

Errorr during srarting the client [unexpected keyword argument 'update_workers']

Errorr during srarting the client:

$ ./telegramTUI

>>> Traceback (most recent call last):
  File "./telegramTUI", line 2, in <module>
    from src.ui import App
  File "/home/vk/Code/Python/Telegram-bots/TelegramTUI/TelegramTUI/src/ui.py", line 2, in <module>
    from src.MainForm import MainForm
  File "/home/vk/Code/Python/Telegram-bots/TelegramTUI/TelegramTUI/src/MainForm.py", line 4, in <module>
    from src.telegramApi import client
  File "/home/vk/Code/Python/Telegram-bots/TelegramTUI/TelegramTUI/src/telegramApi.py", line 200, in <module>
    client = TelegramApi()
  File "/home/vk/Code/Python/Telegram-bots/TelegramTUI/TelegramTUI/src/telegramApi.py", line 46, in __init__
    spawn_read_thread=True, proxy=proxy)
TypeError: __init__() got an unexpected keyword argument 'update_workers'

invalid literal for int()

Hello. Cannot start.

user@desktop:~/TelegramTUI$ ./telegramTUI
Traceback (most recent call last):
  File "./telegramTUI", line 2, in <module>
    from src.ui import App
  File "/home/user/TelegramTUI/src/ui.py", line 2, in <module>
    from src.MainForm import MainForm
  File "/home/user/TelegramTUI/src/MainForm.py", line 4, in <module>
    from src.telegramApi import client
  File "/home/user/TelegramTUI/src/telegramApi.py", line 200, in <module>
    client = TelegramApi()
  File "/home/user/TelegramTUI/src/telegramApi.py", line 46, in __init__
    spawn_read_thread=True, proxy=proxy)
  File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 199, in __init__
    **kwargs
  File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_bare_client.py", line 111, in __init__
    self.api_id = int(api_id)
ValueError: invalid literal for int() with base 10: "*728223'"

get all dialogs

If I have more than 50 contacts, how can I get them all?
message_dialog_len = 50 ????

Copying URL or text to client ends up as gibberish paste

Copying any text or URL from outside the client will scramble the letters, which is very unfortunate when I choose to share URLs. It's actually pretty funny.

Example:

https://www.theverge.com/2019/1/25/18197228/facebook-instagram-whatsapp-merge-messaging-services-mark-zuckerberg

Becomes:

https://www.theverge.com/2019/1/25/18197228/facebook-insgrebrekcuz-kram-secivres-gnigassem-egrem-ppastahw-margat

Is it just me, or does that URL look incredibly eastern European? LOL

Used it and got banned

I just want to put this out as a warning that I have used it and got banned the second time I opened telegramtui.

AttributeError: 'DraftMessageEmpty' object has no attribute 'message'

Hi bad-day!
Thank you for the app development!
I was trying to start it, however, met next:

Signed in successfully as FuriKuri
Traceback (most recent call last):
File "./telegramTUI", line 2, in
from src.ui import App
File "/home/vk/TelegramTUI/src/ui.py", line 2, in
from src.MainForm import MainForm
File "/home/vk/TelegramTUI/src/MainForm.py", line 4, in
from src.telegramApi import client
File "/home/vk/TelegramTUI/src/telegramApi.py", line 200, in
client = TelegramApi()
File "/home/vk/TelegramTUI/src/telegramApi.py", line 54, in init
self.dialogs = self.client.get_dialogs(limit=self.message_dialog_len)
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 664, in get_dialogs
dialogs = UserList(self.iter_dialogs(*args, **kwargs))
File "/usr/lib/python3.5/collections/init.py", line 1037, in init
self.data = list(initlist)
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 645, in iter_dialogs
yield Dialog(self, d, entities, messages)
File "/usr/local/lib/python3.5/dist-packages/telethon/tl/custom/dialog.py", line 82, in init
self.draft = Draft(client, dialog.peer, dialog.draft)
File "/usr/local/lib/python3.5/dist-packages/telethon/tl/custom/draft.py", line 33, in init
self._text = markdown.unparse(draft.message, draft.entities)
AttributeError: 'DraftMessageEmpty' object has no attribute 'message'

Use something like imgcat for displaying images

aalib is nice, but sometimes you want to see actual images, especially when they're gifs. It would be cool if you could optionally integrate something like imgcat for actually displaying color images. It would have to be behind a config option like aalib is.

RuntimeError: generator raised `StopIteration`

Приветствую. Установил приложение и после запуска получаю ошибку:

[vitaliy@Notty TelegramTUI]$ ./telegramTUI
Traceback (most recent call last):
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 16, in get
    yield self.interal_queue.pop()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 18, in get
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./telegramTUI", line 5, in <module>
    TelegeramTUI.run()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 172, in main
    self._THISFORM.edit()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 47, in edit
    self.edit_loop()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop
    self._widgets__[self.editw].edit()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/wgboxwidget.py", line 164, in edit
    self.entry_widget.edit()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/wgmultiline.py", line 596, in edit
    self.get_and_use_key_press()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/wgwidget.py", line 575, in get_and_use_key_press
    return self.try_while_waiting()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/wgwidget.py", line 560, in try_while_waiting
    self.parent.parentApp._internal_while_waiting()
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 41, in _internal_while_waiting
    self.process_event_queues(max_events_per_queue=self.max_events_per_queue)
  File "/home/vitaliy/Documents/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 51, in process_event_queues
    for event in queue.get(maximum=max_events_per_queue):
RuntimeError: generator raised `StopIteration`

Когда изменил функцию до такого вида, завелось:

    def process_event_queues(self, max_events_per_queue=None):
        for queue in self.event_queues.values():
            for event in queue.get(maximum=max_events_per_queue):
                try:
                    self.process_event(event)
                except:
                    pass

Устанавливал по инструкции на Manjaro (Arch based), Python - 3.7.

how to reply to messages

is there a way to reply to messasges? ctrl+r deletes the highlighted message. how can i reply?

Telegram don’t start

ubuntu@ip-172-31-36-140:$ sudo TelegramTUI/./telegramTUI������������������������Traceback (most recent call last):����������������������������������������������� File "/usr/lib/python3.4/configparser.py", line 1116, in _unify_values��������� sectiondict = self._sections[section]����������������������������������������KeyError: 'telegram_api'������������������������������������������������������������������������������������������������������������������������������������������During handling of the above exception, another exception occurred:�����������������������������������������������������������������������������������������������Traceback (most recent call last):����������������������������������������������� File "TelegramTUI/./telegramTUI", line 2, in �������������������������� from src.ui import App������������������������������������������������������� File "/home/ubuntu/TelegramTUI/src/ui.py", line 2, in ����������������� from src.MainForm import MainForm�������������������������������������������� File "/home/ubuntu/TelegramTUI/src/MainForm.py", line 4, in ����������� from src.telegramApi import client������������������������������������������� File "/home/ubuntu/TelegramTUI/src/telegramApi.py", line 200, in ������ client = TelegramApi()������������������������������������������������������� File "/home/ubuntu/TelegramTUI/src/telegramApi.py", line 20, in __init__������� api_id = config.get('telegram_api', 'api_id')�������������������������������� File "/usr/lib/python3.4/configparser.py", line 754, in get�������������������� d = self._unify_values(section, vars)���������������������������������������� File "/usr/lib/python3.4/configparser.py", line 1119, in _unify_values��������� raise NoSectionError(section)������������������������������������������������configparser.NoSectionError: No section: 'telegram_api'��������������������������ubuntu@ip-172-31-36-140:$ �

Cyrillic uppercase 'a' acts as Shift+tab

Steps to reproduce:
Type in Russian layout Shift+'а' (or switch capslock mode on and type cyrillic 'a')

Expected result:
Upper case 'А' is typed.

Actual result:
Previous box is selected (as upon Shift+tab sequence).

Messages seen automatically.

Leaving TelegramTUI open leads to automatically marking messages as read in the current conversation. Is there a way to inhibit this behavior? Being able to have no open conversation would help.

I cant find users as much, only one / What are Contact for?

So most of my lateral window shows a lot of channels but almost no contacts (private messages). I see another block with contacts but nothing works there, tried pushing <Up/Down> but nothing comes.

Please let me know how can I list, find and use the Contact feature.

Crashes on startup, telegramApi.py line 46

root@Bubo:/TelegramTUI# ./telegramTUI
Traceback (most recent call last):
File "./telegramTUI", line 2, in
from src.ui import App
File "/root/TelegramTUI/src/ui.py", line 2, in
from src.MainForm import MainForm
File "/root/TelegramTUI/src/MainForm.py", line 4, in
from src.telegramApi import client
File "/root/TelegramTUI/src/telegramApi.py", line 200, in
client = TelegramApi()
File "/root/TelegramTUI/src/telegramApi.py", line 46, in init
spawn_read_thread=True, proxy=proxy)
TypeError: init() got an unexpected keyword argument 'spawn_read_thread'
root@Bubo:
/TelegramTUI# sudo ./telegramTUI
Traceback (most recent call last):
File "./telegramTUI", line 2, in
from src.ui import App
File "/root/TelegramTUI/src/ui.py", line 2, in
from src.MainForm import MainForm
File "/root/TelegramTUI/src/MainForm.py", line 4, in
from src.telegramApi import client
File "/root/TelegramTUI/src/telegramApi.py", line 200, in
client = TelegramApi()
File "/root/TelegramTUI/src/telegramApi.py", line 46, in init
spawn_read_thread=True, proxy=proxy)
TypeError: init() got an unexpected keyword argument 'update_workers'

Let me know if there's anything I can provide to assist in troubleshooting.

Как его запустить?

Установил все зависимости, и сам телеграм клиент, не могу найти команду для запуска. Буду благодарен за помощь!

Can’t start TelegramTUI

Upon start it fails with the error message below.
OS: Ubuntu 16.04

/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py:1368: UserWarning: get_message_history is deprecated, use get_messages instead
  'get_message_history is deprecated, use get_messages instead'
Traceback (most recent call last):
  File "./telegramTUI", line 5, in <module>
    TelegeramTUI.run()
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 148, in main
    self.onStart()
  File "/home/akitaki/Downloads/TelegramTUI/src/ui.py", line 13, in onStart
    self.MainForm = self.addForm("MAIN", MainForm)
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 55, in addForm
    fm = FormClass( parentApp=self, *args, **keywords)
  File "/home/akitaki/Downloads/TelegramTUI/src/npyscreen/fmForm.py", line 70, in __init__
    self.create()
  File "/home/akitaki/Downloads/TelegramTUI/src/MainForm.py", line 71, in create
    self.chatBoxObj.update_chat()
  File "/home/akitaki/Downloads/TelegramTUI/src/chatBox.py", line 42, in update_chat
    mute_until = int(client.dialogs[i].dialog.notify_settings.mute_until)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Undefined names

import curses or import weakref can solve several of these...

flake8 testing of https://github.com/bad-day/TelegramTUI on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./src/npyscreen/wgmultiselecttree.py:13:21: F821 undefined name 'curses'
                    curses.ascii.SP: self.h_select_toggle,
                    ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:17:34: F821 undefined name 'NPSTree'
            self._myFullValues = NPSTree.NPSTreeData()
                                 ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:18:35: F821 undefined name 'NPSTree'
        elif not isinstance(tree, NPSTree.NPSTreeData):
                                  ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:102:27: F821 undefined name 'weakref'
            self.value = [weakref.proxy(self.values[self.cursor_line]),]
                          ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:111:27: F821 undefined name 'weakref'
            self.value = [weakref.proxy(self.values[self.cursor_line]),]
                          ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:126:13: F821 undefined name 'curses'
            curses.beep()
            ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:142:34: F821 undefined name 'NPSTree'
            self._myFullValues = NPSTree.NPSTreeData()
                                 ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:143:35: F821 undefined name 'NPSTree'
        elif not isinstance(tree, NPSTree.NPSTreeData):
                                  ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:146:37: F821 undefined name 'NPSTree'
            if not isinstance(tree, NPSTree.NPSTreeData):
                                    ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:162:37: F821 undefined name 'weakref'
            if self._cached_tree is weakref.proxy(self._myFullValues) and \
                                    ^
./src/npyscreen/compatibility_code/oldtreeclasses.py:167:29: F821 undefined name 'weakref'
        self._cached_tree = weakref.proxy(self._myFullValues)
                            ^
11    F821 undefined name 'NPSTree'

проблемы с навигацией

tab и shift+tab работают только в иксовом терминале. в чистой консоли без иксов навигация не работает (невозможно переместится на список чатов).

Can run on macOS 10.12.6

I followed the installation steps, bue when I try to run ./telegramTUI I get these errors:

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/telethon/telegram_client.py:1092: UserWarning: get_message_history is deprecated, use get_messages instead
  'get_message_history is deprecated, use get_messages instead'
Traceback (most recent call last):
  File "./telegramTUI", line 2, in <module>
    from src.ui import App
  File "/Users/peppuz/Tele/TelegramTUI/src/ui.py", line 8, in <module>
    from src import aalib
  File "/Users/peppuz/Tele/TelegramTUI/src/aalib.py", line 29, in <module>
    libaa = ctypes.CDLL('libaa.so.1')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(libaa.so.1, 6): image not found

Actually, this line

OSError: dlopen(libaa.so.1, 6): image not found

Makes me think macOS is not supported, am I right? If so, do you plan to support macOS?

Thanks in advance!

config.ini

""you can use few accounts, change it""
я правильно понимаю, что можно добавить несколько аккаунтов?
как это сделать, можно пример?

Не запускается

После ввода кода подтверждения выдает ошибку:
Something wrong: UPDATE_APP_TO_LOGIN
Гугл говорит что это из-за устаревших библиотек телеграм клиента.

'MessageFwdHeader' object has no attribute 'sender' ?

Dear bad-day,
Thank you very much for your wonder code ! I meet this problem when i run start command.

Signed in successfully as Bi
/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py:1369: UserWarning: get_message_history is deprecated, use get_messages instead
'get_message_history is deprecated, use get_messages instead'
Traceback (most recent call last):
File "./telegramTUI", line 5, in
TelegeramTUI.run()
File "/root/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run
return npyssafewrapper.wrapper(self.__remove_argument_call_main)
File "/root/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper
wrapper_no_fork(call_function)
File "/root/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
return_code = call_function(_SCREEN)
File "/root/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
return self.main()
File "/root/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 148, in main
self.onStart()
File "/root/TelegramTUI/src/ui.py", line 13, in onStart
self.MainForm = self.addForm("MAIN", MainForm)
File "/root/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 55, in addForm
fm = FormClass( parentApp=self, *args, **keywords)
File "/root/TelegramTUI/src/npyscreen/fmForm.py", line 70, in init
self.create()
File "/root/TelegramTUI/src/MainForm.py", line 70, in create
self.messageBoxObj.update_messages(0)
File "/root/TelegramTUI/src/messageBox.py", line 27, in update_messages
messages = self.get_messages_info(current_user)
File "/root/TelegramTUI/src/messageBox.py", line 81, in get_messages_info
prepare_forward_message = self.prepare_forward_messages(messages[i])
File "/root/TelegramTUI/src/messageBox.py", line 194, in prepare_forward_messages
sender = fwd_from.sender
AttributeError: 'MessageFwdHeader' object has no attribute 'sender'

App crashes when window is resized

Steps to reproduce:

  1. Open terminal in windowed mode, half screen for example
  2. Now resize it to full-screen
  3. Open another chat

Result: The app crashes with the following message:

/usr/lib/python3.6/site-packages/telethon/telegram_client.py:1092: UserWarning: get_messag                                                             e_history is deprecated, use get_messages instead
  'get_message_history is deprecated, use get_messages instead'
Traceback (most recent call last):
  File "/opt/git/TelegramTUI/src/npyscreen/eveventhandler.py", line 47, in handle_event
    handler(event)
  File "/opt/git/TelegramTUI/src/ui.py", line 71, in event_chat_select
    self.messageBoxObj.update_messages(current_user)
  File "/opt/git/TelegramTUI/src/messageBox.py", line 50, in update_messages
    self.display()
  File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 429, in display
    self.update()
  File "/opt/git/TelegramTUI/src/npyscreen/wgboxwidget.py", line 155, in update
    w.update(clear=clear)
  File "/opt/git/TelegramTUI/src/npyscreen/wgmultiline.py", line 271, in update
    if (self._my_widgets[self.cursor_line - self.start_display_at].task in (MORE_LABEL, "PRINTLINELASTOFSCREEN")):
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./telegramTUI", line 5, in <module>
    TelegeramTUI.run()
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/opt/git/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/opt/git/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 172, in main
    self._THISFORM.edit()
  File "/opt/git/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 47, in edit
    self.edit_loop()
  File "/opt/git/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop
    self._widgets__[self.editw].edit()
  File "/opt/git/TelegramTUI/src/npyscreen/wgboxwidget.py", line 164, in edit
    self.entry_widget.edit()
  File "/opt/git/TelegramTUI/src/npyscreen/wgmultiline.py", line 596, in edit
    self.get_and_use_key_press()
  File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 575, in get_and_use_key_press
    return self.try_while_waiting()
  File "/opt/git/TelegramTUI/src/npyscreen/wgwidget.py", line 560, in try_while_waiting
    self.parent.parentApp._internal_while_waiting()
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 41, in _internal_while_waiting
    self.process_event_queues(max_events_per_queue=self.max_events_per_queue)
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 52, in process_event_queues
    self.process_event(event)
  File "/opt/git/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 70, in process_event
    result = registered_object.handle_event(event)
  File "/opt/git/TelegramTUI/src/npyscreen/eveventhandler.py", line 48, in handle_event
    except weakref.ReferenceError:
AttributeError: module 'weakref' has no attribute 'ReferenceError'

Release it on PyPi

Please,
create a python distribution package and upload it to the Python Package Index PyPI so everyone can just install it with pip using this command:

pip install telegramtui

and then use it with:

telegramtui # or
telegram-tui # or
telegram-cli # or whatever you want

Error when opening chat

So really liking the client so far. A bit slow, but I'm guessing that will be addressed in the future. I have no problem sending messages, etc. However, there's one chat I cannot access. Every time I open it I get the following error:

/usr/local/lib/python3.6/dist-packages/telethon/telegram_client.py:1092: UserWarning: get_message_history is deprecated, use get_messages instead
  'get_message_history is deprecated, use get_messages instead'
Traceback (most recent call last):
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/eveventhandler.py", line 47, in handle_event
    handler(event)
  File "/home/smvg/Downloads/TelegramTUI/src/MainForm.py", line 73, in event_chat_select
    self.messageBoxObj.update_messages(current_user)
  File "/home/smvg/Downloads/TelegramTUI/src/messageBox.py", line 25, in update_messages
    messages = self.get_messages_info(current_user)
  File "/home/smvg/Downloads/TelegramTUI/src/messageBox.py", line 116, in get_messages_info
    self.prepare_media(out, media, name, image_name, read, mess_id, color, date)
  File "/home/smvg/Downloads/TelegramTUI/src/messageBox.py", line 253, in prepare_media
    if not os.path.isfile(os.getcwd() + "/downloads/" + str(media.photo.id) + ".jpg"):
AttributeError: 'NoneType' object has no attribute 'id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./telegramTUI", line 5, in <module>
    TelegeramTUI.run()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationManaged.py", line 172, in main
    self._THISFORM.edit()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 47, in edit
    self.edit_loop()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop
    self._widgets__[self.editw].edit()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/wgboxwidget.py", line 164, in edit
    self.entry_widget.edit()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/wgmultiline.py", line 596, in edit
    self.get_and_use_key_press()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/wgwidget.py", line 575, in get_and_use_key_press
    return self.try_while_waiting()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/wgwidget.py", line 560, in try_while_waiting
    self.parent.parentApp._internal_while_waiting()
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 41, in _internal_while_waiting
    self.process_event_queues(max_events_per_queue=self.max_events_per_queue)
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 52, in process_event_queues
    self.process_event(event)
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/apNPSApplicationEvents.py", line 70, in process_event
    result = registered_object.handle_event(event)
  File "/home/smvg/Downloads/TelegramTUI/src/npyscreen/eveventhandler.py", line 48, in handle_event
    except weakref.ReferenceError:
AttributeError: module 'weakref' has no attribute 'ReferenceError'

Keep up the good work!

Documentation issues

To install whis app on system like Arch you need to install aalib:
sudo pacman -S aalib
or you'll get an error OSError: libaa.so.1 no such file or directory

and you need to have python image library (pillow):
sudo pip install pillow

Isn't better to show an error message when socket.timeout except crashing?

Traceback (most recent call last):
  File "./telegramTUI", line 2, in <module>
    from src.ui import App
  File "/home/yahya/dev/python/TelegramTUI/src/ui.py", line 2, in <module>
    from src.MainForm import MainForm
  File "/home/yahya/dev/python/TelegramTUI/src/MainForm.py", line 4, in <module>
    from src.telegramApi import client
  File "/home/yahya/dev/python/TelegramTUI/src/telegramApi.py", line 196, in <module>
    client = TelegramApi()
  File "/home/yahya/dev/python/TelegramTUI/src/telegramApi.py", line 47, in __init__
    self.client.start()
  File "/usr/local/lib/python3.6/dist-packages/telethon/telegram_client.py", line 313, in start
    self.connect()
  File "/usr/local/lib/python3.6/dist-packages/telethon/telegram_bare_client.py", line 207, in connect
    self._sender.connect()
  File "/usr/local/lib/python3.6/dist-packages/telethon/network/mtproto_sender.py", line 68, in connect
    self.connection.connect(self.session.server_address, self.session.port)
  File "/usr/local/lib/python3.6/dist-packages/telethon/network/connection/tcpfull.py", line 25, in connect
    self.conn.connect(ip, port)
  File "/usr/local/lib/python3.6/dist-packages/telethon/extensions/tcp_client.py", line 78, in connect
    self._socket.connect(address)
  File "/usr/local/lib/python3.6/dist-packages/socks.py", line 100, in wrapper
    return function(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/socks.py", line 825, in connect
    super(socksocket, self).connect((dest_addr, dest_port))
socket.timeout: timed out

OSError: libaa.so.1: cannot open shared object file: No such file or directory

Hey all,

I can install TGTUI fine with pipenv as well as pip, but when I try to launch the client I keep getting this error:

OSError: libaa.so.1: cannot open shared object file: No such file or directory

Any idea what's wrong? I tried both Python 3.6, and 3.7.

Here's the full:

Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/bin/telegramtui", line 11, in <module>
    load_entry_point('telegramtui', 'console_scripts', 'telegramtui')()
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/TelegramTUI/telegramtui/__main__.py", line 1, in <module>
    from telegramtui.src.ui import App
  File "/home/TelegramTUI/telegramtui/src/ui.py", line 2, in <module>
    from telegramtui.src.MainForm import MainForm
  File "/home/TelegramTUI/telegramtui/src/MainForm.py", line 6, in <module>
    from telegramtui.src import messageBox
  File "/home/TelegramTUI/telegramtui/src/messageBox.py", line 5, in <module>
    from telegramtui.src import aalib
  File "/home/TelegramTUI/telegramtui/src/aalib.py", line 4, in <module>
    import aalib
  File "/root/.local/share/virtualenvs/TelegramTUI-y2cX0UwA/lib/python3.7/site-packages/aalib.py", line 29, in <module>
    libaa = ctypes.CDLL('libaa.so.1')
  File "/usr/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libaa.so.1: cannot open shared object file: No such file or directory

Asked for password

I am trying to login into the application but its asking me for a password due to the two step authentication. I have never set a password for telegram.

But I am not sure about what to do moving forward. Where can I see this password. Is the two step password mandatory.

Minor UI Issue: long names in message box

In case one is using small terminal window & opens a chat\channel\whatever with somebody with very long name, the chat looks like it is presented on the screenshot below.

It might be better to check name length and in case it is longer than (10|20|?) characters to move the message under the sender's name. Or to put messages awlays under the sender's name. Or to cut names longer than (10|20|?) characters.

2018-03-24-135739_814x463_scrot

Allow custom user key-mappings

I would love to remap send from Alt+Enter to Ctrl+Enter. Would you consider exposing the key mappings in telegramtui.ini, please?
I love the program by the way!

How to change default background color?

Just started using TelegramTUI today, and everything is working as intended. However, how do I change the background color? I can tell that the typography color is locally set in the terminal settings, but I can't seem to find the file that controls the default background color. I'd like it to match my terminal background color, so any help would be greatly appreciated.

Cheers

I can't start it

/usr/lib/python3.6/site-packages/telethon/telegram_client.py:1212: UserWarning: get_message_history is deprecated, use get_messages instead 'get_message_history is deprecated, use get_messages instead' Traceback (most recent call last): File "./telegramTUI", line 2, in <module> from src.ui import App File "/home/byayoi/workspace/TelegramTUI/src/ui.py", line 2, in <module> from src.MainForm import MainForm File "/home/byayoi/workspace/TelegramTUI/src/MainForm.py", line 4, in <module> from src.telegramApi import client File "/home/byayoi/workspace/TelegramTUI/src/telegramApi.py", line 196, in <module> client = TelegramApi() File "/home/byayoi/workspace/TelegramTUI/src/telegramApi.py", line 76, in __init__ @self.client.on(events.Raw(chats=None, blacklist_chats=False)) TypeError: __init__() got an unexpected keyword argument 'chats'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.