nanoseb / nctelegram Goto Github PK
View Code? Open in Web Editor NEWA ncurse Telegram client developed in Python
License: GNU General Public License v3.0
A ncurse Telegram client developed in Python
License: GNU General Public License v3.0
Sometimes it randomly crashes and this Traceback is shown:
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 91, in __init__
self.main_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 719, in _loop
self._watch_files[fd]()
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 393, in <lambda>
event_loop, callback, self.get_available_raw_input())
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 493, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 403, in _update
self.process_input(keys)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 503, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 2269, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 195, in keypress
key = super(ChanWidget, self).keypress(size, key)
File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 985, in keypress
key = focus_widget.keypress((maxcol,),key)
File "/usr/lib/python3/dist-packages/urwid/wimp.py", line 535, in keypress
self._emit('click')
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 463, in _emit
signals.emit_signal(self, name, self, *args)
File "/usr/lib/python3/dist-packages/urwid/signals.py", line 264, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
File "/usr/lib/python3/dist-packages/urwid/signals.py", line 294, in _call_callback
return bool(callback(*args_to_pass))
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 177, in chan_change
self.Telegram_ui.msg_widget.get_history()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
When a message (in a group chat) is pinned, ncTelegram is crashing.
I get the following error when running nctelegram
. This is weird, because it worked yesterday:
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.4/dist-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/__init__.py", line 73, in __init__
self.msg_widget = MessageWidget(self)
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
self.get_history()
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
Sometimes going through the channel list it crashes with the following traceback.
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 70, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 87, in __init__
self.main_loop.run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 719, in _loop
self._watch_files[fd]()
File "/usr/lib/python3.5/site-packages/urwid/raw_display.py", line 393, in <lambda>
event_loop, callback, self.get_available_raw_input())
File "/usr/lib/python3.5/site-packages/urwid/raw_display.py", line 493, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 403, in _update
self.process_input(keys)
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 509, in process_input
something_handled |= bool(self.unhandled_input(k))
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 555, in unhandled_input
return self._unhandled_input(input)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 236, in unhandle_key
self.chan_widget.go_prev_chan()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 152, in go_prev_chan
self.chan_change('bu', self.chans[self.current_chan_pos])
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 176, in chan_change
self.Telegram_ui.msg_widget.get_history()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 51, in get_history
self.print_msg(msg)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 146, in print_msg
(urwid.AttrSpec(color_fwd, ''), msg['fwd_from']['first_name'] + '\n')] + text
KeyError: 'first_name'
Main reason is that many terminal bitmap fonts do not have have support for these characters. Specifying a fallback font may be best, but I'd rather see it work like so: if support for a character is found, use that character, if not, use a more common replacement.
I don't have any ideas what we could replace these exotics characters with right now.
here is the output
jyf@test:~/repot/git$ nctelegram
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/__init__.py", line 67, in __init__
self.chan_widget = ChanWidget(self)
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_chanwidget.py", line 21, in __init__
self.get_new_chan_list()
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_chanwidget.py", line 47, in get_new_chan_list
self.update_chan_list()
File "/usr/local/lib/python3.4/dist-packages/ncTelegram/ui_chanwidget.py", line 59, in update_chan_list
self.Telegram_ui.current_chan = self.chans[-1]
IndexError: list index out of range
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.4/subprocess.py", line 960, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.4/subprocess.py", line 1602, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: str object does not have the buffer interface
read: Connection reset by peer
jyf@test:~/repot/git$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.7 (jessie)
Release: 8.7
Codename: jessie
and i follow the instruction of the project's readme
Traceback (most recent call last):
File "/bin/nctelegram", line 93, in
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.6/site-packages/ncTelegram/init.py", line 73, in init
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 25, in init
self.get_history()
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 194, in print_msg
self.focus_position = self.pos
File "/usr/lib/python3.6/site-packages/urwid/listbox.py", line 578, in set_focus
raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.6/subprocess.py", line 843, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.6/subprocess.py", line 1499, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
read: Connection reset by peer
System:
Manjaro, 4.14.48
Hi
nctelegram on Arch. Builded today. Nctelegram freeze at start. Just empty output. If i press Ctl+C it hows traceback i pasted below...
^CTraceback (most recent call last):
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 32, in get_new_chan_list
self.chans = self.Telegram_ui.sender.dialog_list()
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, _args, *_kwargs)
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 351, in execute_function
return result_parser(message)
File "/usr/lib/python3.5/site-packages/pytg/result_parser.py", line 105, in call
raise IllegalResponseException("Not a list: {json}".format(json=str(json)))
pytg.exceptions.IllegalResponseException: Not a list: {'error': 'RPC_CALL_FAIL 401: AUTH_KEY_UNREGISTERED', 'result': 'FAIL', 'error_code': 71}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 79, in
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.5/site-packages/ncTelegram/init.py", line 63, in init
self.chan_widget = ChanWidget(self)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 21, in init
self.get_new_chan_list()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 35, in get_new_chan_list
time.sleep(0.5)
KeyboardInterrupt
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.5/subprocess.py", line 1072, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.5/subprocess.py", line 1700, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
read: Connection reset by peer
Just an idea for now at least in early development to ensure the user isn't open a billion telegram-cli's if nctelegram isn't closing it properly.
First off I wanna say what you've written is pretty damn cool. Also please be gentle as I'm a Linux user but not a coder. I have a proper full Linux machine at home I plan on trying this on but here at work I have WSL. More info on WSL here: https://docs.microsoft.com/en-us/windows/wsl/install-win10
So ran through all the steps, pretty smoothly. I did end up with telegram-cli in my user dir. No problem. It runs fine from there without root, I copied the conf file to my home dir, and modified it. ASt the moment I basically have all the top options disabled. Notifications, images, etc to make it as compatible as possible.
I tried to run it and for the errors below. I eventually closed out of WSL, closing all it's windows. I tried to launch it again and it worked! I managed to send a message to a friend. I verified it worked and see the sent message on my phone's Telegram client. I used the arrows and moved over to the Telegram "friend" just to see the verification message, and it crashed again. BTW WSL uses Ubuntu.
It may be that this just can't work reliably or barely at all with WSL. It seems like it's some kind of connectivity issue in WSL, maybe a ipchains/firewall thing? Not sure. Anyway you may not bew interested in fixing something like this. Or it may not be your code at all it could easily be my setup. But I thought I would send it your way. Cheers and thanks.
`$ nctelegram
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/init.py", line 73, in init
self.msg_widget = MessageWidget(self)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 25, in init
self.get_history()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed`
Hello. When I start nctelegram, I get this error message:
~ $ nctelegram
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.4/dist-packages/pytg/receiver.py", line 159, in _receiver
raise ArithmeticError("Server response does not fit. (Got >{}<)".format(buffer))
ArithmeticError: Server response does not fit. (Got >b'\nA'<)
This is all I get. No interface, no way to quit the program cleanly.
Traceback (most recent call last):
File "/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
AttributeError: module 'ncTelegram' has no attribute 'Telegram_ui'
Any idea?
Ctrl-w should be used for deleting the previous word (up to last space), while ctrl-u should delete the entire line. Currently ctrl-w has the typical ctrl-u behavior.
As both emacs and vi (in insert mode) respect both of these bindings it's probably best to have these as defaults. Very nice project however.
snowy@ccaynoski-pc01:/usr/bin$ nctelegram
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 39, in __init__
self.start_Telegram()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 187, in start_Telegram
pubkey_file=PATH_PUBKEY)
File "/usr/local/lib/python3.5/dist-packages/pytg/__init__.py", line 33, in __init__
self.start_cli(telegram=telegram, pubkey_file=pubkey_file, custom_cli_args=custom_cli_args, port=port)
File "/usr/local/lib/python3.5/dist-packages/pytg/__init__.py", line 86, in start_cli
self._proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, preexec_fn=preexec_function)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '~/s/tg'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/pytg/__init__.py", line 102, in stop_cli
if self.sender:
AttributeError: 'Telegram' object has no attribute 'sender'
This is on the windows 10 Ubuntu bash thing and for more or less everything else ive done with this I have been able to just use the straight Ubuntu version of commands
[general]
path_telegram = ~/s/tg
path_pubkey = ~/s/tg/server.pub
are the stuff in my ~/.ncTelegram.conf that was said to change both are symbolic links
Its possible to use it on OSX?. Im having problems.
Hi all,
I'm not sure if it's the right place for this request. First of all, thanks very much for this client, it really works like charm. I like very much the interface, but I wonder if it's planned to implement the possibility to switch to an interface without the side bar, similiar to the one of hangups (git here) in which contact list is another tab, instead of a fixed portion of the screen. This would be perfect when someone adopts the client from a tiling window manager, in which often the horizontal space is not much. Consider that if it's true that a big portion of nctelegram users are... tty maniacs :) , I think that many others are just twm users which appreciate gui with beautiful lightweight apps like this.
Thanks anyway!
p
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 70, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 62, in __init__
self.chan_widget = ChanWidget(self)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 21, in __init__
self.get_new_chan_list()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 41, in get_new_chan_list
cmd = chan['type'] + "#" + str(chan['id'])
KeyError: 'type'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib64/python3.5/subprocess.py", line 1068, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib64/python3.5/subprocess.py", line 1687, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
read: Connection reset by peer
Like the title states. Also after changing the name (probably from the history). Name was 𝒞ℴ𝓂𝓅𝓊𝓉ℯ𝓇 𝒢𝓇ℴ𝓊𝓅 .
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 91, in __init__
self.main_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 719, in _loop
self._watch_files[fd]()
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 393, in <lambda>
event_loop, callback, self.get_available_raw_input())
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 493, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 403, in _update
self.process_input(keys)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 509, in process_input
something_handled |= bool(self.unhandled_input(k))
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 555, in unhandled_input
return self._unhandled_input(input)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 254, in unhandle_key
self.chan_widget.go_next_chan()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 144, in go_next_chan
self.chan_change('bu', self.chans[self.current_chan_pos])
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 177, in chan_change
self.Telegram_ui.msg_widget.get_history()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/local/lib/python3.5/dist-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
Cant start nctelegram, i have installed all the dependencies
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 13, in <module>
for connection in psutil.net_connections():
hi all,
i am using macOS High Sierra v 10.13.4 on my macbook. python
and python3
are installed via homebrew.
i git cloned this repository and tried to run python3 setup.py install
(each command, i also tried running without the 3
, both for python3
and pip3
); this creates the following error message
$ python3 setup.py install -- INSERT --
/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install
running build
running build_py
error: package directory 'ncTelegram' does not exist
when i just run ncTelegram
, i get this error
$ ./ncTelegram -- INSERT --
Traceback (most recent call last):
File "./ncTelegram2", line 9, in <module>
import ncTelegram
ModuleNotFoundError: No module named 'ncTelegram'
this looks like a really great telegram client, which i would love to still use until i can make the final switch from osx to a linux distribution.
any help would be greatly appreciated :) thanks in advance for your support!
Can't find any information about getting public key. In config I have an option for it. But how can i get it?
Hi,
I can't seem to be able to paste text with the middle clic from the mouse on linux, nor with ctrl+v, is there a way to do it?
Thanks!
Is there an option to have the message feed scroll when you send a new message? Right now it doesn't show messages I sent until I mouse over and scroll down manually. Works fine for incoming messages.
jon: nctelegram
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 93, in
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.7/site-packages/ncTelegram/init.py", line 73, in init
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 25, in init
self.get_history()
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 194, in print_msg
self.focus_position = self.pos
File "/usr/lib/python3.7/site-packages/urwid/listbox.py", line 578, in set_focus
raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.7/subprocess.py", line 920, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.7/subprocess.py", line 1643, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
read: Connection reset by peer
not sure what's causing this exactly, is something not linked right? all dependencies should be in.
When trying to open nctelegram after upgrade to urwid version 2.0, the program crashes
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 73, in __init__
self.msg_widget = MessageWidget(self)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
self.get_history()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 194, in print_msg
self.focus_position = self.pos
File "/usr/local/lib/python3.5/dist-packages/urwid/listbox.py", line 578, in set_focus
raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.5/subprocess.py", line 1072, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.5/subprocess.py", line 1700, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
read: Connection reset by peer
Forcing a downgrade to urwid==1.3 opens correctly
Is it possible to install nctelegram on OSX?
All attempts failing with 'ncTelegram' module not found, same for setup.py.
Thanks
Hi, thanks for the awesome project!
I have an issue with notifications.
I checked that notifications works on my machine.
I investigated why they are not called by ncTelegram and discovered that conditions for them aren't met:
# notif on hl
if 'text' in msg and 'username' in self.Telegram_ui.me and \
self.Telegram_ui.me['username'] != None and\
"@" + self.Telegram_ui.me['username'] in msg['text']:
self.Telegram_ui.display_notif(msg)
Can you suggest what to check next?
Hi, I think you forgot to include python3-pip.
infie@chill-arch ~ % nctelegram
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 93, in
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.8/site-packages/ncTelegram/init.py", line 73, in init
Exception in thread Receiver (pytg):
Traceback (most recent call last):
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 25, in init
self.run()
self.get_history()
File "/usr/lib/python3.8/threading.py", line 870, in run
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
File "/usr/lib/python3.8/site-packages/pytg/receiver.py", line 125, in _receiver
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 630, in command_alias
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
return self.execute_function(command_name, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
After successfuly initialize telegram-cli
and trying to start nctelegram
now, lead to the following error message:
bind: Address already in use
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.7/site-packages/ncTelegram/__init__.py", line 73, in __init__
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
self.get_history()
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 66, in get_history
self.draw_separator()
File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 246, in draw_separator
self.focus_position = self.separator_pos
File "/usr/lib/python3.7/site-packages/urwid/listbox.py", line 578, in set_focus
raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty
I've installed it through the ArchLinux user repository.
I see that in the screenshot on the README there are two buttons for creating a new {channel,group}
, but I don't have those. How?
Hi,
I would like to have a new message notification (an icon) display in polybar, either as it's own bar module or in the systray. Is this currently possible with ncTelegram? I have libnotify installed but I don't receive any popup notifications. I am not sure if libnotify can be used to send notifcations to polybar, or if something more is needed?
Arch Linux, all packages up to date. Fresh install of nctelegram
.
telegram-cli
succeeds, but the following error appears after running the command nctelegram
(after initialising telegtram-cli
, as instructed)
❯ nctelegram
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 9, in <module>
import ncTelegram
File "/usr/lib/python3.8/site-packages/ncTelegram/__init__.py", line 11, in <module>
from pytg import Telegram
File "/usr/lib/python3.8/site-packages/pytg/__init__.py", line 9, in <module>
from luckydonaldUtils.encoding import to_unicode as u
ModuleNotFoundError: No module named 'luckydonaldUtils'
I'm not sure when this began, as for a while last year I had nctelegram
working, though inconsistently.
There's a certain buffer that, whenever I try to open it, it crashes out with this error message:
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 79, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 87, in __init__
self.main_loop.run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 719, in _loop
self._watch_files[fd]()
File "/usr/lib/python3.5/site-packages/urwid/raw_display.py", line 393, in <lambda>
event_loop, callback, self.get_available_raw_input())
File "/usr/lib/python3.5/site-packages/urwid/raw_display.py", line 493, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 403, in _update
self.process_input(keys)
File "/usr/lib/python3.5/site-packages/urwid/main_loop.py", line 503, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/usr/lib/python3.5/site-packages/urwid/container.py", line 2269, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 194, in keypress
key = super(ChanWidget, self).keypress(size, key)
File "/usr/lib/python3.5/site-packages/urwid/listbox.py", line 985, in keypress
key = focus_widget.keypress((maxcol,),key)
File "/usr/lib/python3.5/site-packages/urwid/wimp.py", line 535, in keypress
self._emit('click')
File "/usr/lib/python3.5/site-packages/urwid/widget.py", line 463, in _emit
signals.emit_signal(self, name, self, *args)
File "/usr/lib/python3.5/site-packages/urwid/signals.py", line 264, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
File "/usr/lib/python3.5/site-packages/urwid/signals.py", line 294, in _call_callback
return bool(callback(*args_to_pass))
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_chanwidget.py", line 176, in chan_change
self.Telegram_ui.msg_widget.get_history()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 51, in get_history
self.print_msg(msg)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 98, in print_msg
image = self.get_inline_img(msg)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 243, in get_inline_img
path = self.Telegram_ui.download_media(msg)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 158, in download_media
file = self.sender.load_document(mid)
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 351, in execute_function
return result_parser(message)
File "/usr/lib/python3.5/site-packages/pytg/result_parser.py", line 74, in downloaded_file
raise IllegalResponseException("Has no valid event attribute.")
pytg.exceptions.IllegalResponseException: Has no valid event attribute.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.5/subprocess.py", line 1072, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.5/subprocess.py", line 1700, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
Not sure if this is a bug in nctelegram or one of the other libraries... Luckily, this buffer is the one where I can send messages to myself, so I guess it's not real crucial. I'm using the nctelegram-git package in Arch
Hi. I try to install nctelegram-git
on Arch and yaourt
write error: target not found: telegram-cli
. And when I try to install telegram-cli
yaourt
write same. telegram-cli-git
established normally, but nctelegram-git
not install :(
when trying to transfer some file (like a screenshot), ncTelegram crashes.
Here follows a pad with the resulting error message:
When trying to open nctelegram on arch:
Exception in thread Receiver (pytg):
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 93, in <module>
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.8/site-packages/ncTelegram/__init__.py", line 73, in __init__
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self.msg_widget = MessageWidget(self)
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
File "/usr/lib/python3.8/site-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
self.get_history()
pytg.exceptions.ConnectionError: Remote end closed.
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/lib/python3.8/site-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/lib/python3.8/site-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
Instead of using libcaca to convert images to chunky coloured text, please consider using libsixel, which allows (sufficiently capable) terminals to render proper bitmap graphics.
This should make it easier to see what that sticker is supposed to be.
This evening nctelegram just stopped working, here is the output I received. Tries to load and then crashes straight away.
Traceback (most recent call last):
File "/usr/bin/nctelegram", line 79, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.5/site-packages/ncTelegram/__init__.py", line 69, in __init__
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 23, in __init__
self.get_history()
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 51, in get_history
self.print_msg(msg)
File "/usr/lib/python3.5/site-packages/ncTelegram/ui_msgwidget.py", line 120, in print_msg
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/site-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout, retry_connect=retry_connect)
File "/usr/lib/python3.5/site-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
This way we can have real images in the terminal. Here's an article about w3m-img.
When I run ncTelegram and click on a special chat ncTelegram crashes with this error:
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 91, in __init__
self.main_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 719, in _loop
self._watch_files[fd]()
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 393, in <lambda>
event_loop, callback, self.get_available_raw_input())
File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 493, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 403, in _update
self.process_input(keys)
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 503, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 2269, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 195, in keypress
key = super(ChanWidget, self).keypress(size, key)
File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 985, in keypress
key = focus_widget.keypress((maxcol,),key)
File "/usr/lib/python3/dist-packages/urwid/wimp.py", line 535, in keypress
self._emit('click')
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 463, in _emit
signals.emit_signal(self, name, self, *args)
File "/usr/lib/python3/dist-packages/urwid/signals.py", line 264, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
File "/usr/lib/python3/dist-packages/urwid/signals.py", line 294, in _call_callback
return bool(callback(*args_to_pass))
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 177, in chan_change
self.Telegram_ui.msg_widget.get_history()
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 147, in print_msg
sender_reply = msg_reply['sender']['first_name']
KeyError: 'first_name'
Also ncTelegram doesn't start at all, if the chat is the newest in the history.
This error appears only in one chat.
telegram-cli was installed with snap
Here's the traceback:
$ nctelegram
telegram-cli: loop.c:742: accept_incoming: Assertion `fd >= 0' failed.
Traceback (most recent call last):
File "/usr/local/bin/nctelegram", line 93, in <module>
ncTelegram.Telegram_ui(config_full)
File "/usr/local/lib/python3.6/dist-packages/ncTelegram/__init__.py", line 39, in __init__
self.start_Telegram()
File "/usr/local/lib/python3.6/dist-packages/ncTelegram/__init__.py", line 187, in start_Telegram
pubkey_file=PATH_PUBKEY)
File "/usr/local/lib/python3.6/dist-packages/pytg/__init__.py", line 52, in __init__
raise AssertionError("CLI Process died.")
AssertionError: CLI Process died.
I used the ncTelegram.conf from this repo, and modified the first 2 parts like so:
$ cat .ncTelegram.conf | head -n 3
[general]
path_telegram = /snap/bin/telegram-cli
path_pubkey = /home/user/tg/server.pub
~/tg
also has tg-server.pub
in it, and I tried using that too, but I get the exact same traceback
It's curious because the only results to sudo updatedb && locate server.pub
are the 2 items in ~/tg
, and I don't think that directory comes from snap, but from a failed attempt of me installing telegram-cli, before realizing I could use snap. I can't seem to find those server.pub
files from the snap install
I'm running ubuntu
$ Traceback (most recent call last):
File "/usr/bin/nctelegram", line 93, in <module>
Exception in thread Receiver (pytg):
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/site-packages/pytg/receiver.py", line 125, in _receiver
raise ConnectionError("Remote end closed.")
pytg.exceptions.ConnectionError: Remote end closed.
ncTelegram.Telegram_ui(config_full)
File "/usr/lib/python3.6/site-packages/ncTelegram/__init__.py", line 73, in __init__
self.msg_widget = MessageWidget(self)
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
self.get_history()
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
self.print_msg(msg)
File "/usr/lib/python3.6/site-packages/ncTelegram/ui_msgwidget.py", line 141, in print_msg
msg_reply = self.Telegram_ui.sender.message_get(msg['reply_id'])
File "/usr/lib/python3.6/site-packages/pytg/sender.py", line 630, in command_alias
return self.execute_function(command_name, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/pytg/sender.py", line 320, in execute_function
result = self._do_send(request, answer_timeout=self.default_answer_timeout,
retry_connect=retry_connect)
File "/usr/lib/python3.6/site-packages/pytg/sender.py", line 507, in _do_send
raise ConnectionError("Remote end closed")
pytg.exceptions.ConnectionError: Remote end closed
this is what happen even if I leave it open doing nothing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.