Telegram uses phone numbers just as UIDs, they're not shared to anyone without your permission.
As for Discord, I've got a few accounts and have been asked for telephone numbers 0 times. It's only needed when a specific server demands it, haven't seen any yet.
If discord has too few selectors (IP, email, browser fingerprint, useragent, behavior) to identify you from or they are too generic, they will demand that you use a phone number. Low-reputation IP addresses do this especially, you'll be locked right out of an account for using one. I'd rather be able to just pay them money for an account than have to go use a VPS or residential proxy in order to avoid the phone requirement.
As for Discord, I've got a few accounts and have been asked for telephone numbers 0 times. It's only needed when a specific server demands it, haven't seen any yet.