From 8f6ac35f1db02fd9ecd3a66e2a1cbcf47bc5cf11 Mon Sep 17 00:00:00 2001 From: Onur Atakan ULUSOY Date: Tue, 23 Apr 2024 21:26:38 +0300 Subject: [PATCH] Fixed number for telegram --- .../tools/communication/telegram/as_user/delete_message.py | 6 +++--- .../communication/telegram/as_user/get_last_dialogs.py | 2 +- .../communication/telegram/as_user/get_last_messages.py | 6 +++--- tiger/tools/communication/telegram/as_user/send_message.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tiger/tools/communication/telegram/as_user/delete_message.py b/tiger/tools/communication/telegram/as_user/delete_message.py index d375f42..8beec90 100644 --- a/tiger/tools/communication/telegram/as_user/delete_message.py +++ b/tiger/tools/communication/telegram/as_user/delete_message.py @@ -4,10 +4,10 @@ from telethon.sync import TelegramClient -def delete_message(number: str, message: str): +def delete_message(id: int, message: str): """ - :param number: str: + :param id: int: :param message: str: """ @@ -21,7 +21,7 @@ async def del_message(num, message): "7d0ebd20538d88ab0629eb926acb08f7") as client: await client.delete_messages(num, message) - asyncio.run(del_message(number, message)) + asyncio.run(del_message(id, message)) tool_name = "communication.telegram.as_user.delete_message" diff --git a/tiger/tools/communication/telegram/as_user/get_last_dialogs.py b/tiger/tools/communication/telegram/as_user/get_last_dialogs.py index 45f5dbe..54f166c 100644 --- a/tiger/tools/communication/telegram/as_user/get_last_dialogs.py +++ b/tiger/tools/communication/telegram/as_user/get_last_dialogs.py @@ -41,7 +41,7 @@ async def fetch_recent_chats(limit): meta_information = number number = chat.entity.id chat_names[str(chat.id)] = { - "number": number, + "id": number, "title": chat.name or chat.title, "type_of_entity": type_of_entity, "unread_count": chat.unread_count, diff --git a/tiger/tools/communication/telegram/as_user/get_last_messages.py b/tiger/tools/communication/telegram/as_user/get_last_messages.py index a9ee8c7..c979d37 100644 --- a/tiger/tools/communication/telegram/as_user/get_last_messages.py +++ b/tiger/tools/communication/telegram/as_user/get_last_messages.py @@ -4,10 +4,10 @@ from telethon.sync import TelegramClient -def get_last_messages(number: str, limit=100): +def get_last_messages(id: int, limit=100): """ - :param number: str: + :param id: int: :param limit: (Default value = 100) """ @@ -49,7 +49,7 @@ async def get_messages(num, limit): } return the_messages_list - messages = asyncio.run(get_messages(number, limit)) + messages = asyncio.run(get_messages(id, limit)) return messages diff --git a/tiger/tools/communication/telegram/as_user/send_message.py b/tiger/tools/communication/telegram/as_user/send_message.py index 8c695a2..5618136 100644 --- a/tiger/tools/communication/telegram/as_user/send_message.py +++ b/tiger/tools/communication/telegram/as_user/send_message.py @@ -4,10 +4,10 @@ from telethon.sync import TelegramClient -def send_message(number: int, message: str) -> str: +def send_message(id: int, message: str) -> str: """ - :param number: int: + :param id: int: :param message: str: """ @@ -21,7 +21,7 @@ async def send_message(number, message): "7d0ebd20538d88ab0629eb926acb08f7") as client: return (await client.send_message(number, message)).id - result = asyncio.run(send_message(number, message)) + result = asyncio.run(send_message(id, message)) return result