this bot will help you to get IDs of users from the join actions from the Telegrams Admin Log
You will need Telethon. Install it via:
apt-get install telethon
You also need your own App_id etc., this is explained in a lot of docs.
Maybe have a look at that: https://telethon.readthedocs.io/en/stable/extra/basic/creating-a-client.html
this was a very short project idea, I don't care about anything. It should work.