diff --git a/Interviews/Interview.cs b/Interviews/Interview.cs index fc5fe19..d925947 100644 --- a/Interviews/Interview.cs +++ b/Interviews/Interview.cs @@ -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 paths; + public Dictionary paths = new(); // //////////////////////////////////////////////////////////////////////////// // The following parameters are populated by the bot, not the json template. // diff --git a/Interviews/interview_template.schema.json b/Interviews/interview_template.schema.json index 9e0fe4e..9d714a0 100644 --- a/Interviews/interview_template.schema.json +++ b/Interviews/interview_template.schema.json @@ -134,7 +134,7 @@ "minimum": 0 } }, - "required": [ "message", "message-type", "color", "paths" ], + "required": [ "message", "message-type", "color" ], "unevaluatedProperties": false } }, diff --git a/docs/InterviewTemplates.md b/docs/InterviewTemplates.md index 61273b7..ff5242c 100644 --- a/docs/InterviewTemplates.md +++ b/docs/InterviewTemplates.md @@ -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 Yes String -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. @@ -184,7 +185,7 @@ Colour of the message embed. You can either enter a colour name or a hexadecimal `paths` - Yes + No Steps One or more interview steps. The name of the step is used as a regex match against the user's answer,