[Python] How to get last message id from Telegram Channel?

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    I need to get last message ID from Telegram Channel in channel_message_id, here is my Code:

    import telegram

    bot = telegram.Bot(token='TOKEN')

    user_id = 745466988

    updates = bot.get_updates()

    channel_message_id = 100

    channel_id = '@Space_of_Cars'

    bot.forward_message(chat_id=user_id, from_chat_id=channel_id, message_id=channel_message_id)


    Have someone any ideas?

    I tried to ask ChatGPT, but he didn't give me correct answer.

    Continue reading...

Compartilhe esta Página