Improve enum documentation #6935
Replies: 2 comments
-
that message type exists in openapi spec: In client, it looks like that: Sample purchase notification message payload: {
author: buyer,
content: '',
type: 44,
purchase_notification: {
type: 0,
guild_product_purchase: {
listing_id:'1150842812263305296',
product_name:':trolley:'
},
},
// ... rest of fields
} clicking |
Beta Was this translation helpful? Give feedback.
-
in the meantime you can check out our unofficial user docs, for example here's better documentation for all the message types https://docs.discord.sex/resources/message#message-type |
Beta Was this translation helpful? Give feedback.
-
There are numerous enums in the API documentation, which usually only have the type name and type number (or bit position) in a large table.
To properly make use of these types, we need to know what the purpose and context is.
Enums like Message Types have a lot of different values, with some being very unclear.
For instance, what are the differences between all the boost types or what is
REPLY
. Please add more details to the documentation, as a library developer I have to go out of my way to find them in the wild to know what the purpose is. Another recent addition,PURCHASE_NOTIFICATION
, is one I don't know the purpose or context of.Potential candidates for better documentation:
Honorable mention List of Intents. This really could use a better formatting, including links to the actual events.
Another honorable mention is JSON Error Codes. Here the errors are actually well described, but they should also be referenced in the endpoints where they appear. They could also use proper enum names, similar to other enums in the documentation. Note that the API spec currently only uses "integer" to type these error codes, instead of a proper enum.
Examples of good documentation:
Beta Was this translation helpful? Give feedback.
All reactions