How can I add txt dns record to domain?

Only if the TXT record is a SPF record, in that case you can add it on that section.

But if the TXT record needs a name for it, in this case you can’t add other types of TXT records on free hosting. Also, Cloudflare doesn’t support our subdomains, so you’ll have to get your own domain, and here are two websites where you can get one for free:

After this you can add it to Cloudflare and add the record Discord requires to add you.