Merge branch 'dev' into kldk_dev

This commit is contained in:
fish-dd 2025-01-29 01:07:33 +03:00 committed by GitHub
commit bc897fe7db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 10 deletions

View File

@ -64,7 +64,7 @@ class ChatScreen(Screen):
self,
name = None,
id = None,
classes = None,
classes = None,
telegram_client: TelegramClient | None = None
):
super().__init__(name, id, classes)
@ -145,5 +145,5 @@ class ChatScreen(Screen):
with Horizontal(id="chats"):
yield VerticalScroll(Static(id="chat_container"))
#TODO: сделать кнопку чтобы прогрузить больше чатов
yield Dialog(telegram_client=self.telegram_client)

View File

@ -27,8 +27,7 @@ class Chat(Widget):
)
global personid
personid = 0
self.notify = notify_func
self.notify = notify_fun
def _on_click(self):
global personid
@ -56,7 +55,6 @@ class Dialog(Widget):
self.messages = []
for messages1 in self.telegram_client.iter_dialogs(self.personid, limit=5):
messages.append(messages1.text)
def compose(self):
messages = self.messages
@ -67,7 +65,7 @@ class Dialog(Widget):
yield Message(message=messages[2], is_me=False)
yield Message(message=messages[3], is_me=True)
yield Message(message=messages[4], is_me=False)
# должно быть примерно
# is_me = message.from_id == client.get_peer_id("me")
@ -86,8 +84,6 @@ class Dialog(Widget):
self.app.notify("Нажато отправить")
self.message_text = self.query_one("#msg_input").value
await self.telegram_client.send_message(personid, str(self.message_text))
class Message(Widget):
"""Класс виджета сообщений для окна диалога"""

View File

@ -1,4 +1,4 @@
"""Получите свои API-ключи на https://my.telegram.org/apps"""
api_id = 21321
api_hash = "yourhashherebro"
api_id = 12345
api_hash = "0123456789abcdef"