The script is a slightly modified version of its original from: https://replit.com/@viperadnan/genstring so credits to viperadnan.
Make an app with the Telegram API: https://my.telegram.org/apps, install the requirements if they're not already installed by running ‘pip install -r requirements.txt’, then run the script using 'python main.py'.
When prompted, choose an option and fill in the details requested, then the session string is sent to your Saved Messages in Telegram.