added modal json template files
This commit is contained in:
@@ -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 {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"form_id": "DO_NOT_USE_THE_SAME_ID_TWICE",
|
||||
"form_id": "form_demo",
|
||||
"title": "Demo form",
|
||||
"form": [
|
||||
{
|
18
form_templates/template_general.json
Normal file
18
form_templates/template_general.json
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
20
form_templates/template_ticket.json
Normal file
20
form_templates/template_ticket.json
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
15
form_templates/template_url.json
Normal file
15
form_templates/template_url.json
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user