There is no way to get historical data with the Telegram Bot API. But you can do this using a user account and the Telethon library. https://docs.telethon.dev/en/stable/ Quick start page here https://docs.telethon.dev/en/stable/basic/quick-start.html
However, this method will also allow you to receive only 100 messages at a time.