Arguably on IRC you can use OTR (you need a secure medium to exchange a secret or fingerprints). Its usability is awful so barely anyone uses it, but at least you can.
I guess you could do it with a browser extension, but they'll probably think you use a third-party client if they notice you're sending encrypted text.
There was actually a plugin for BetterDiscord that did that that I used (probably 2 years ago now). Can't find it anymore, but it did exist and worked pretty well.