from telethon import TelegramClient, events, utils
import server
async def handler_all(event):
pinned_message = ''
server.post(pinned_message)
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