To prevent others from accessing your Telegram account via UID (tg://user?id=number), you need to restrict who can find you by phone number to My Contacts.
Follow these steps:
- Open Settings: Go to Telegram on your phone, tap the Settings icon at the bottom right.
- Privacy and Security: Tap Privacy and Security.
- Phone Number: Find and tap Phone Number.
- Restrict Discovery: Set Who can find me by my number to My Contacts.
Note: If you have previously added someone to your contacts, or if they know your @Username, they can still start a conversation. To completely avoid being found by strangers, consider removing your username and not sharing your phone number publicly.