The foul is that PII per California law the user has the right to know what information is collected, how it's used/shared, and request the data to be deleted. Discord is based in California and will be under subject to these laws.
Looking through Discord's ToS and Privacy Policy, gender isn't mentioned once. And age is mentioned once in the Privacy Policy in regards to account creation.
This practice circumvents the law by gathering this information without the user's express permission.