Don't have Telegram yet? Try it now!
https://macmule.com/2014/12/07/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/
How To: Change the "Automatic Proxy Configuration" url in System Preferences via a Script