Made paths no longer required

This commit is contained in:
Toastie 2024-12-27 16:34:28 +13:00
parent d4be9cb849
commit 47ff409902
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
3 changed files with 10 additions and 9 deletions

View file

@ -36,7 +36,7 @@ public enum ButtonType
// A tree of questions representing an interview.
// The tree is generated by the config file when a new ticket is opened or the restart interview command is used.
// Additional components not specified in the config file are populated as the interview progresses.
// The entire interview tree is serialized and stored in the database in order to record responses as they are made.
// The entire interview tree is serialized and stored in the database to record responses as they are made.
public class InterviewQuestion
{
// Title of the message embed.
@ -83,7 +83,7 @@ public class InterviewQuestion
// Possible questions to ask next, an error message, or the end of the interview.
[JsonProperty("paths")]
public Dictionary<string, InterviewQuestion> paths;
public Dictionary<string, InterviewQuestion> paths = new();
// ////////////////////////////////////////////////////////////////////////////
// The following parameters are populated by the bot, not the json template. //

View file

@ -134,7 +134,7 @@
"minimum": 0
}
},
"required": [ "message", "message-type", "color", "paths" ],
"required": [ "message", "message-type", "color" ],
"unevaluatedProperties": false
}
},

View file

@ -77,6 +77,7 @@ It is highly recommended to use the interview template JSON schema to get live v
This section lists all the properties that can be used in an interview template.
If you have set up your editor as suggested above it will handle a lot of this for you automatically.
Here is a simple example of an interview asking a user for their favourite colour out of the different button colours:
```json
{
"category-id": "1006863882301755503",
@ -88,7 +89,7 @@ If you have set up your editor as suggested above it will handle a lot of this f
"summary-field": "Favourite colour",
"paths":
{
"PRIMARY":
"Blue":
{
"message": "Summary",
"message-type": "END_WITH_SUMMARY",
@ -96,7 +97,7 @@ If you have set up your editor as suggested above it will handle a lot of this f
"button-style": "PRIMARY",
"paths": {}
},
"SECONDARY":
"Gray":
{
"message": "Summary",
"message-type": "END_WITH_SUMMARY",
@ -104,7 +105,7 @@ If you have set up your editor as suggested above it will handle a lot of this f
"button-style": "SECONDARY",
"paths": {}
},
"SUCCESS":
"Green":
{
"message": "Summary",
"message-type": "END_WITH_SUMMARY",
@ -112,7 +113,7 @@ If you have set up your editor as suggested above it will handle a lot of this f
"button-style": "SUCCESS",
"paths": {}
},
"DANGER":
"Red":
{
"message": "Summary",
"message-type": "END_WITH_SUMMARY",
@ -162,7 +163,7 @@ The text in the embed message that will be sent to the user when they reach this
<td>Yes</td>
<td>String</td>
<td>
The type of message, decides what the bot will do when the user gets to this step.
The type of message, decides what the bot will do when the user gets to this step. See the list of message types below for more info.
<!-- For whatever reason this tag cannot be indented -->
</td>
@ -184,7 +185,7 @@ Colour of the message embed. You can either enter a colour name or a hexadecimal
<td>
`paths`
</td>
<td>Yes</td>
<td>No</td>
<td>Steps</td>
<td>
One or more interview steps. The name of the step is used as a regex match against the user's answer,