diff --git a/cmd_form.go b/cmd_form.go index c455762..940162a 100644 --- a/cmd_form.go +++ b/cmd_form.go @@ -87,12 +87,12 @@ var form_command Command = Command{ Interact: func(s *discordgo.Session, i *discordgo.InteractionCreate) { switch i.ApplicationCommandData().Options[0].Name { case "help": - fileData, _ = os.ReadFile("./attachments/example_modal.json") + fileData, _ = os.ReadFile("./form_templates/form_demo.json") fileReader := bytes.NewReader(fileData) s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "Get the example file edit it and submit it via `/form create`.\nOr use the demo button to get an idea of how the example would look like.", + Content: "Get the example file edit it (make sure to have a unique \"form_id\") and submit it via `/form create`.\nOr use the demo button to get an idea of how the example would look like.", Flags: discordgo.MessageFlagsEphemeral, Files: []*discordgo.File{ { @@ -284,7 +284,7 @@ var form_command Command = Command{ func getFormIDs() []string { //needs custom IDs from databank - return []string{"form_demo", "template_feedback", "template_ticket", "template_url", "template_general"} + return []string{"form_demo", "template_ticket", "template_url", "template_general"} } func getFormButtonIDs() []string { diff --git a/attachments/example_modal.json b/form_templates/form_demo.json similarity index 92% rename from attachments/example_modal.json rename to form_templates/form_demo.json index 7b60679..048811c 100644 --- a/attachments/example_modal.json +++ b/form_templates/form_demo.json @@ -1,5 +1,5 @@ { - "form_id": "DO_NOT_USE_THE_SAME_ID_TWICE", + "form_id": "form_demo", "title": "Demo form", "form": [ { diff --git a/form_templates/template_general.json b/form_templates/template_general.json new file mode 100644 index 0000000..8b29132 --- /dev/null +++ b/form_templates/template_general.json @@ -0,0 +1,18 @@ +{ + "form_id": "template_general", + "title": "Form", + "form": [ + { + "label": "Title", + "is_paragraph": false, + "required": true, + "max_length": 20 + }, + { + "label": "Text", + "is_paragraph": true, + "required": true, + "max_length": 2000 + } + ] +} diff --git a/form_templates/template_ticket.json b/form_templates/template_ticket.json new file mode 100644 index 0000000..cf2a898 --- /dev/null +++ b/form_templates/template_ticket.json @@ -0,0 +1,20 @@ +{ + "form_id": "template_ticket", + "title": "Submit your Ticket", + "mods_can_comment": true, + "form": [ + { + "label": "Title", + "is_paragraph": false, + "required": true, + "max_length": 20 + }, + { + "label": "Ticket information", + "is_paragraph": true, + "placeholder": "Fill in what you need or have issues with and a moderator will reply.", + "required": true, + "max_length": 2000 + } + ] +} diff --git a/form_templates/template_url.json b/form_templates/template_url.json new file mode 100644 index 0000000..9ed816c --- /dev/null +++ b/form_templates/template_url.json @@ -0,0 +1,15 @@ +{ + "form_id": "template_url", + "title": "Submit URL", + "form": [ + { + "label": "URL", + "is_paragraph": false, + "placeholder": "https://example.com", + "value": "", + "required": true, + "min_length": 0, + "max_length": 100 + } + ] +}