C#C
C#17mo ago
13eck

Hope to declare class member with variable type

I’m making a simple dice rolling Discord app and I’m having issues creating classes for some of the data types as they have variable type members.

Specifically, the Application command interaction data option has a value field that can be a string, integer, double, or boolean.

How do I accommodate this in a class? I’m honestly thinking of just reading from a JsonDocument and not worrying about it, but that can’t be a good idea, long-term, right?
Was this page helpful?