from pyrogram import Client
api_id = 12345
api_hash = "0123456789abcdef0123456789abcdef"
PostChannel = 'channel'
app = Client("my_account", api_id, api_hash)
def GetScheduledMsg():
with app:
n = True
for message in app.get_chat_history(PostChannel):
if message.from_scheduled:
print(message.text)
n = False
if n:
print('нету')
GetScheduledMsg()