Skip to content

Commit

Permalink
Fixed number for telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Apr 23, 2024
1 parent 1d7d2a1 commit 8f6ac35
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tiger/tools/communication/telegram/as_user/delete_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
"""
Expand Down Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions tiger/tools/communication/telegram/as_user/send_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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


Expand Down

0 comments on commit 8f6ac35

Please sign in to comment.