from collections.abc import Mapping
def __deep_update(source : dict, overrides : dict):
for key, value in overrides.items():
if isinstance(value, Mapping) and value:
returned = __deep_update(source.get(key, {}), value)
source[key] = returned
else:
source[key] = overrides[key]
return source
from telethon import TelegramClient, events, utils
import server
async def handler_all(event):
if event.action_message == None and event.new_pin == True:
return
channel_id = event.action_message.peer_id.channel_id
message_id = event.action_message.reply_to.reply_to_msg_id
print(message_id)
messages = await client.get_messages(channel_id, limit=100)
for message in messages:
if message.id == message_id:
print("[+] Найдено новое закрепленное сообщение")
server.post(message.text)
break