© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
2y ago
•
15 replies
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
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
JsonDocument
and not worrying about it
, but that can
’t be a good idea
, long
-term
, right
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
❔ Pass variable type as class parameter
C
C# / help
3y ago
cannot convert from 'TypeA' to 'TypeB' with generics
C
C# / help
2y ago
✅ Can a variable be of a type of variable or class?
C
C# / help
3y ago