paul-nameless / tg

terminal telegram client
The Unlicense
952 stars 74 forks source link

tg doesn't send message; #305

Open Rick21-bit opened 1 year ago

Rick21-bit commented 1 year ago

I installed tg recently on arch. It can do everything but write any type of message. 'i' or 'a' doesn't do anything

Here is the error.log ERROR [2023-09-30 14:03:41,761] controllers.py:776 - handle | Error happend in key handle loop Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle res = fun(self, repeat_factor) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor return fun(self) ^^^^^^^^^ File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg if not self.can_send_msg() or chat_id is None: ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg return chat["permissions"]["can_send_messages"]


KeyError: 'can_send_messages'
ERROR [2023-09-30 14:03:42,406] controllers.py:776 - a
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:03:43,457] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:03:43,742] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:03:46,046] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 276, in reply_message
    if not self.can_send_msg():
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:19:58,082] update_handlers.py:32 - wrapper | Error happened in handler: updateNewMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 79, in update_new_message
    controller.notify_for_message(msg.chat_id, msg)
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 879, in notify_for_message
    name = f"{user['first_name']} {user['last_name']}"
              ~~~~^^^^^^^^^^^^^^
KeyError: 'first_name'
ERROR [2023-09-30 14:20:06,553] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:06,825] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:06,991] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:07,121] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:07,293] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:07,450] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:07,626] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:07,779] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:20:22,769] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:22:38,025] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:23:10,177] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:23:16,009] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:23:27,082] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:23:30,356] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:23:38,036] update_handlers.py:32 - wrapper | Error happened in handler: updateChatDraftMessage
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 30, in wrapper
    fun(controller, update)
  File "/usr/lib/python3.11/site-packages/tg/update_handlers.py", line 190, in update_chat_draft_message
    order = update["order"]
            ~~~~~~^^^^^^^^^
KeyError: 'order'
ERROR [2023-09-30 14:32:49,973] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:32:50,655] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:32:51,001] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:33:41,640] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:33:41,958] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:33:42,310] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:34:30,645] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:34:31,392] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'
ERROR [2023-09-30 14:34:34,278] controllers.py:776 - handle | Error happend in key handle loop
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 770, in handle
    res = fun(self, repeat_factor)  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 56, in _no_repeat_factor
    return fun(self)
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 317, in write_short_msg
    if not self.can_send_msg() or chat_id is None:
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/tg/controllers.py", line 489, in can_send_msg
    return chat["permissions"]["can_send_messages"]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'can_send_messages'

How can i fix this? 
sabitov-kirill commented 1 year ago

Same problem on Arch Linux

doclai commented 1 year ago

Same problem here on Arch

Omixxx commented 1 year ago

Same problem here. I personally don't get any errors, but the functionality still doesn't work. I use arch (maybe we are the problem? :smile: )

aincube commented 1 year ago

For me, permissions looks like this:

'permissions': {'@type': 'chatPermissions', 'can_send_basic_messages': True, 'can_send_audios': True, 'can_send_documents': True, 'can_send_photos': True, 'can_send_videos': True, 'can_send_video_notes': True, 'can_send_voice_notes': True, 'can_send_polls': True, 'can_send_other_messages': True, 'can_add_web_page_previews': True, 'can_change_info': False, 'can_invite_users': False, 'can_pin_messages': True, 'can_manage_topics': False},

There is no can_send_messages. So I've just changed the line 489 in controllers.py from ["can_send_messages"] to ["can_send_basic_messages"] and it works.

Sabin-Rusu commented 1 year ago

Same problem on Arch and modifying controllers.py doesn't fix it for me

pasha-dushny commented 12 months ago

Same problem after update of libtd

[2023-11-26T22:56:53+0300] [ALPM] upgraded libtd (1.8.5-1 -> 1.8.16-1)

So I've just changed the line 489 in controllers.py from ["can_send_messages"] to ["can_send_basic_messages"] and it works.

it helps

mindtheegab commented 10 months ago

changing can_send_messages to can_send_basic_messages fixed it for me

grbll commented 10 months ago

Where do I change these setting? I use tg installed from AUR on Arch. After some update I am unable to even write message (i,I,a,A all do Nothing).

aincube commented 9 months ago

Where do I change these setting? I use tg installed from AUR on Arch. After some update I am unable to even write message (i,I,a,A all do Nothing). You can check where package was installed and then change it manually in any editor or by sed

#Check where file controllers.py was installed:
pacman -Ql telegram-tg | grep "controllers.py"
#Check if line 489 contains what we need to change
sed -n '489'p /path/to/controllers.py
#Modify line 489
sed -i '489s/.*/        return chat["permissions"]["can_send_basic_messages"]/' /path/to/controllers.py